Washington (AFP) - The United States on Thursday threw its weight behind the newly elected president of Iraq, Fuad Masum, and urged him to form a "cohesive government" to help fight Islamic militants.

"By taking this crucial step, the Council of Representatives has demonstrated its commitment to uniting the country according to the constitution," deputy State Department spokeswoman Marie Harf said, offering Washington's congratulations on Masum's election.

"Iraq’s leaders now must take the next step in their democratic process by choosing a prime minister and forming a government," she said in a statement as Iraq seeks to quell an offensive by militants who have seized a swathe of territory in the north of the country.

"Only with an inclusive, cohesive government that represents all Iraqis can Iraq most effectively and successfully confront the urgent security and humanitarian challenges it faces in the fight against" the Islamic State (IS), Harf added.

Masum's election on Thursday is another step towards forming a government which could see long-time embattled Prime Minister Nuri al-Maliki replaced, even though his party won the largest bloc in April parliamentary elections.

The June onslaught on Sunni Arab areas north and west of Baghdad led by IS has brought Iraq to the brink of break-up, with the government struggling to assert any authority beyond its Shiite power base.

Parliament elected Masum, a Kurdish politician 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 after Kurdish parties struck a late-night deal to support him.