BAGHDAD — Iraq’s embattled Prime Minister Nouri al-Maliki, in a surprise speech late Sunday, resisted calls for his resignation and accused the country’s new president of violating the constitution, plunging the government into a political crisis at a time it is battling advances by Islamic State militants.
Al-Maliki is seeking a third-term as prime minister, but the latest crisis has prompted even his closest allies to call for his resignation. A parliament session scheduled for Monday to discuss the election and who might lead the next Iraqi government was postponed until Aug. 19.
On Sunday night, in a nationally televised speech, al-Maliki declared he will file a legal complaint against the new president, Fouad Massoum, for committing ‘‘a clear constitutional violation.’’
Al-Maliki, whose Shiite-dominated bloc won the most seats in April elections, accused Massoum of neglecting to name a prime minister from the country’s largest parliamentary faction by Sunday’s deadline. He said the president has violated the constitution ‘‘for the sake of political goals.’’
Al-Maliki, speaking on Iraqi TV for the first time since U.S. forces launched airstrikes and humanitarian airdrops in Iraq last week, said the security situation will only worsen as a result of Massoum’s actions.
‘‘This attitude represents a coup on the constitution and the political process in a country that is governed by a democratic and federal system,’’ al-Maliki said. ‘‘The deliberate violation of the constitution by the president will have grave consequences on the unity, the sovereignty, and the independence of Iraq and the entry of the political process into a dark tunnel.
The political infighting could hamper efforts to stem advances by Sunni militants who have seized a large swath of northern and western Iraq in recent weeks.
President Barack Obama warned Americans on Saturday that the new campaign to bring security in Iraq requires military and political changes and ‘‘is going to be a long-term project.’’ Obama said Iraqi security forces need to revamp to effectively mount an offensive, which requires a government in Baghdad that the Iraqi military and people have confidence in. Obama said Iraq needs a prime minister — an indication that suggests he’s written off the legitimacy of the incumbent, al-Maliki.
Critics say the Shiite leader contributed to the crisis by monopolizing power and pursuing a sectarian agenda that alienated the country’s Sunni and Kurdish minorities.
After al-Maliki’s speech, Brett McGurk, a deputy assistant secretary of state for Iraq and Iran, expressed support for Massoum.
‘‘Fully support President of Iraq Fuad Masum as guarantor of the Constitution and a PM nominee who can build a national consensus,’’ McGurk tweeted.
The U.S. airstrikes have reinvigorated Kurdish forces battling the Islamic State militants in northern and western Iraq. Kurdish forces retook two towns from the Sunni militants on Sunday, achieving one of their first victories after weeks of retreating, a senior Kurdish military official said.
Kurdish peshmerga fighters were able to push the militants of the Islamic State group out of the villages of Makhmour and al-Gweir, some 28 miles (45 kilometers) from the Kurdish capital of Irbil, Brig. Gen. Shirko Fatih said.
The United States launched a fourth round of airstrikes Sunday against militant vehicles and mortars firing on Irbil as part of efforts to blunt the militants’ advance and protect American personnel in and around the Kurdish capital.
U.S. warplanes and drones have also attacked militants firing on minority Yazidis around Sinjar, which is in the far west of the country near the Syrian border.
In the Kurdish capital on Sunday, the president of the semi-autonomous Kurdish Regional Government, Massoud Barzani, said American military support has been effective thus far, but, he added, peshmerga soldiers require more firepower to defeat the militants.
‘‘We are not asking our friends to send their sons to fight on our behalf,’’ Barzani told The Associated Press in a brief interview. ‘‘What we are asking our friends is to provide us support and to cooperate with us in providing us with heavy weapons that we are able to fight this terrorist group.’’
Barzani met Sunday with French Foreign Minister Laurent Fabius, who traveled to Baghdad and Irbil pledging France’s commitment to providing humanitarian aid. Fabius also met with al-Maliki and called on Iraqi leaders to unite in the face of the escalating crisis.
‘‘The marching order is solidarity,’’ Fabius said. He called on Iraqis to form a ‘‘government of broad unity so that all Iraqis feel represented and together lead the battle against terrorism.’’
A week ago, Al-Maliki ordered the Iraqi air force to support Kurdish forces against the militants, in a rare instance of cooperation between Baghdad and the Kurdish regional government, which have for years been locked in disputes over oil and territory.
Meanwhile, thousands of Yazidi refugees fleeing the militants continued to pour across the border from Syria into Iraq after a weeklong journey through blazing hot mountains. Followers of an ancient religion with links to Zoroastrianism, the Yazidis said the militants had given them the choice of converting to Islam or dying.
As they crossed the border, many Yazidis said they had lost sisters, daughters, young children and elderly parents during the trip. They said militants sprayed gunfire at fleeing crowds, sometimes splitting up families by taking the women and killing the men.
It was not clear how many Yazidis were missing. In the span of 30 minutes, about a dozen displaced Yazidis approached one journalist, pleading for assistance to find their loved ones.
British officials estimated Saturday that 50,000 to 150,000 people could be trapped on Sinjar Mountain, where they fled to escape the Islamic extremists, only to become stranded there with few supplies.
Britain said its air force has already dropped water containers and solar lanterns over the mountains.
During his Sunday blessing at the Vatican, Pope Francis expressed outrage at the violence aimed at religious minorities in Iraq and called on the world ‘‘to stop these crimes.’’
He cited ‘‘the thousands of people, including Christians, who have been brutally forced from their homes, children who have died from thirst during the escape and women who have been seized.’’
He also spoke of ‘‘the destruction of religious, historic and cultural treasures.’’
In a statement issued Sunday, the European Union said it was ‘‘appalled by the rapid deterioration of the humanitarian situation, with hundreds of thousands civilians, mainly from minorities, fleeing the areas of conflict.’’
Some of the militants’ acts ‘‘may constitute crimes against humanity and must be investigated swiftly, so that the perpetrators are held accountable,’’ the EU said.