Baghdad, Iraq (CNN) -- Nuri al-Maliki says he is stepping down as Iraq's leader, but true to form, he's doing it on his own terms.
Al-Maliki announced Thursday on Iraqi state-run television, he was withdrawing his candidacy for a third term and endorsing the Prime Minister-elect, effectively ending his fight to keep his post.
"I announce to you today that I am withdrawing my candidacy in deference to my brother, Haider al-Abadi, in the highest interest of the country," he said.
But al-Maliki will continue to serve as the country's caretaker Prime Minister for at least the next 30 days, the deadline for the Parliament to form a new government.
The news comes at a critical time in Iraq as fighters with the Islamic State of Iraq and Syria, which calls itself the Islamic State, wage a brutal campaign as it seizes large swaths of the country.
The announcement -- first flashed on state television -- follows mounting pressure, at home and abroad, for al-Maliki to step aside and make way from someone to bridge the sectarian divide that many accuse him of fomenting.
It was a turnaround for al-Maliki, who in recent days called the appointment of al-Abadi unconstitutional and said he would not step down.
Al-Maliki had filed a lawsuit in federal court to stop the formation of a new government and said he wouldn't step down until the court ruled.
The announcement followed reports that the ISIS siege that kept thousands of refugees trapped on an Iraqi mountain is over, President Barack Obama declared Thursday, but the crisis for the Yazidis is far from solved.
While humanitarian airdrops and U.S. airstrikes saved those stranded from starving and provided safe passage off of the mountain, the refugees arrived by the thousands at camps in and outside Iraq.
With the news that the situation in the Sinjar Mountains was greatly improved, Obama said there would not be a need for a major evacuation operation, as had been discussed.
This follows a 24-hour mission by about 20 U.S. State Department and military personnel in the Sinjar Mountains.
The team found that food and water was reaching those in need and that U.S. airstrikes pushed militants back to allow those trapped on the mountain to leave, Obama said in an address during his vacation in Martha's Vineyard.
The civilians who remained on the mountain continued to leave under the protection of the Kurdish pershmerga forces, he said.
Once believed to be in the tens of thousands, the number ofYazidis found to be there is "now in the low thousands," Brett McGurk, a deputy assistant secretary of state, said Wednesday.
"The Yazidis who remain are in better condition than previously believed and continue to have access to the food and water that we have dropped," Pentagon spokesman Rear Adm. John Kirby said, citing the success of humanitarian airdrops and airstrikes against ISIS.
A humanitarian airdrop that took place on Wednesday "could very well be the last one," Kirby said Thursday. The U.S. team that assessed the situation in the Sinjar Mountains found many pallets of unopened food and water.
Airstrikes will continue as needed, Kirby said, but the 130 U.S. troops sent this week as an assessment team are now likely to return to their home bases.
Map: Where is ISIS?
"We broke the siege" by ISIS, Obama said.
James Jeffrey, a former U.S. ambassador to Iraq, told CNN's "New Day" that although the operation is a success so far for Obama, it is a mistake to declare victory too early.
The crisis certainly is not what it was a week ago, thanks to the airstrikes and humanitarian airdrops, he said. The airstrikes have halted the advance of ISIS in some areas, but the group is not broken, Jeffrey said.
On Thursday, there were reports that ISIS was advancing south and west of Kirkuk.
An estimated 1,600 ISIS fighters were spread across and occupying four towns to the south and west of Kirkuk, said Hisham al-Hashimi, a researcher on ISIS at the Journalistic Freedom Observatory. According to his sources in the field, there was fighting ongoing between ISIS and Kurdish Peshmerga in the town of Tuz Khumatu.
A Yazidi family's harrowing flight to escape ISIS
The United Nations on Wednesday announced its highest level of emergency for a humanitarian crisis, saying the number of people on the run from ISIS is of grave concern.
It estimates that more than 400,000 people have been driven from their homes since June, when ISIS swept across the border from Syria into Iraq.
The group has waged a brutal campaign while seizing large swaths of northern and western Iraq, aiming to establish a caliphate -- an Islamic state -- that stretches from Syria to Iraq.
Of those displaced, more than 200,000 have poured into Dohuk province in recent weeks, where refugee camp populations have swelled since ISIS began its assault against Yazidis, Christians and Kurds.
Who are the religious and ethnic groups under threat from ISIS?
Thousands of other refugees sought protection inside the northern Kurdish region of Iraq.
"To be blunt, we don't have housing for all of them. We don't have shelter," a spokesman for the U.N. human rights commissioner, Edward Colt, said at a camp near the Peshkhabour bridge where Iraqis are entering the area. "Thousands of tents are being erected as we speak."
Yazidi refugees were also fleeing across the Iraqi border into Syria.
As of Thursday, there were about 15,000 Yazidi refugees from Iraq who arrived at the Newroz camp in Syria, the U.N. refugee agency said. Thousands more are arriving, the agency said.
Many refugees go back to northern Iraq after a few days to reunite with family, the agency said. The United Nations has rushed tents, plastic sheets, blankets and other necessities to the camp.
By declaring what it calls a "Level 3 Emergency," the United Nations says it will trigger more resources to help.
The Yazidis fled last week as ISIS overran the city of Sinjar.
A senior commander said ISIS fighters abducted more than 100 Yazidi women and children from the community.
The ISIS commander, who has knowledge of the events that unfolded, said the fighters killed a large number of men when they took over the town more than a week ago.
"At that time, they took Yazidi women and children, and I can confirm those women and children have entered Mosul," the commander said by telephone. "...The Islamic State is taking this opportunity to call them to Islam."
'Heroic' mission rescues desperate Yazidis from ISIS
While CNN cannot independently confirm the claim, it follows reports by survivors who describe ISIS fighters grabbing families and separating the men from the women and children.
The plight of the Yazidis, coupled with the ISIS assault against Iraq's semiautonomous Kurdish region, prompted the United States to begin the targeted airstrikes.