BAGHDAD — Iraq’s new president on Monday snubbed the powerful incumbent Prime Minister Nouri al-Maliki and nominated the deputy parliament speaker to form the new government, raising fears of more infighting in the government as country faces the threat of Sunni militants in the north.

The announcement comes after word of the United States directly providing weapons to the Kurdish peshmerga forces who have started to make gains against the Islamic State militant group that controls much of the north.

In a televised address Iraq President Fouad Massoum gave Haider al-Ibadi, who was selected by a coalition of Shiite political parties, 30 days to form a new government and present it to parliament for approval.

The ceremony came hours after the embattled al-Maliki delivered a surprise speech at midnight accusing the Massoum of blocking his reappointment as prime minister and carrying out “a coup against the constitution and the political process.”

Al-Maliki’s Dawa party then issued a televised statement rejecting the new nominee, saying he did not have the support of the party.

“Al-Ibadi represents only himself,” said party spokesman Khalaf Abdul-Samad surrounded by stone-faced party members, including al-Maliki.

Al-Ibadi, who pledged to form a government to “protect the Iraqi people,” was nominated for the post by the Iraqi National Alliance, a coalition of Shiite parties that includes al-Maliki’s.

The powerful Shiite cleric, Muqtada al-Sadr, whose movement controls dozens of seats in parliament, expressed his support for al-Ibadi’s nomination, describing it as the “first sign” the country was headed back to safety.

“I think that this nomination will be an important start in order to end the crisis that the people are undergoing such as security and service problems,” he said in a statement.

Al-Ibadi is a British-educated lawmaker with a background in electrical engineering and a member of al-Maliki’s Islamic Dawa party. He has been closely involved in previous governments.

Critics say al-Maliki, a Shiite, has contributed to the crisis facing the country by monopolizing power and pursuing a sectarian agenda that alienated the country’s Sunni and Kurdish minorities.

Al-Ibadi’s nomination came hours after al-Maliki deployed his elite security forces in the streets of Baghdad, partially closed two main streets — popular spots for pro and anti-government rallies — as hundreds of his supporters took to the streets, raising fears that he might use force to stay in power.

“We are with you, al-Maliki,” they shouted, waving posters of the incumbent premier, singing and dancing.

Hakim al-Zamili, a lawmaker with the Sadrist movement, cautioned the military, which includes units directly loyal to al-Maliki, not to intervene.

“The security forces and government bodies belong to the Iraqi people, and they should not interfere in politics,” he said when asked whether al-Maliki might use force to stay in power.

The new political crisis in Baghdad has raised concerns abroad.

Speaking to reporters in Sydney, U.S. Secretary of State John Kerry said the U.S. stands “absolutely squarely behind President Massoum,” and called for restraint. “There should be no use force, no introduction of troops or militias into this moment of democracy for Iraq.”

Kerry said a new government “is critical in terms of sustaining the stability and calm in Iraq,” and that “our hope is that Mr. Maliki will not stir those waters.”

The U.N. special representative for Iraq, Nickolay Mladenov, said Iraq’s “special forces should refrain from actions that may be seen as interference in matters related to the democratic transfer of political authority.”

Britain has expressed support for Ibadi’s nomination and Vice President Joe Biden called the Massoum to express the U.S. support and commend him on the nomination.

Also Monday, senior U.S. officials said the Obama administration, which launched airdrops and airstrikes last week to support Kurdish and Iraqi forces battling militants from the Islamic State group, has begun directly providing weapons to the Kurdish peshmerga forces.

U.S. airstrikes have reinvigorated Iraqi Kurdish forces battling the Islamic State and on Sunday, the Kurdish peshmerga fighters retook two towns — Makhmour and al-Gweir, some 28 miles (45 kilometers) from the Kurdish capital of Irbil — from the Sunni militants in what was one of their first victories after weeks of retreat.

The successes, however, were balanced out by news of a defeat in the far eastern Diyala province where Kurdish forces were driven out of the town of Jalula after fierce fighting against Sunni militants.

The militants blasted their way into the town at midnight using a truck bomb followed up with several suicide bombers on foot, said a police officer and a army official, adding that at least 14 Kurdish fighters were killed.

The officials spoke on condition of anonymity because they were not authorized to speak to the press.

The move to directly arm the Kurds underscores the level of U.S. concern about the Islamic State’s gains. The officials wouldn’t say which U.S. agency is providing the arms or what weapons are being sent, but one official said it isn’t the Pentagon. The CIA has historically done similar quiet arming operations. The officials spoke on condition of anonymity because they were not authorized to discuss the operation publicly.

The militant advances and the political turmoil has deepened Iraq’s humanitarian crisis, with some 200,000 Iraqis recently joining the 1.5 million people already displaced from violence this year.

The U.S. also announced the deployment of a disaster response team to Iraq help distribute humanitarian aid to those forced from their homes in the fresh wave of violence in the country’s north.