A June onslaught on Sunni Arab areas north and west of of Baghdad led by the jihadist Islamic State group has brought Iraq to the brink of breakup, with the government struggling to assert any authority beyond its Shiite power base.
Parliament elected Masum, who served as the first prime minister of Iraq's autonomous Kurdish region more than two decades ago, by an overwhelming majority of 211 votes to 17.
Under an unofficial power-sharing deal, Iraq's Kurds traditionally get the post of president.
The move could pave the way for a deal on the much more powerful post of prime minister.
More From This Section
The UN chief met current Prime Minister Nuri al-Maliki and stressed the need for a broad-based government to be formed as soon as possible to save the country from collapse.
"Iraq is facing an existential threat but it can be overcome by the formation of a thoroughly inclusive government," he said at a joint news conference with Maliki.
The Shiite premier has accused mainstream politicians from the Sunni Arab minority of condoning the IS offensive and of "dancing in the blood" of the onslaught's victims.
But many retort it was Maliki's own brand of sectarian politics that brought the country to the brink of collapse, and he now faces intense domestic and foreign pressure to step aside.
He was also criticised over the army's poor performance in the face of the lightning offensive launched in second city Mosul on June 9.
According to police and medical sources, at least 60 people died in the attack, which saw militants ram a security convoy with a suicide car bomb before detonating other bombs and raking it with gunfire.