(CNN) -- A day after taking over Mosul, Iraq's second-largest city, militants nearly gained nearly complete control of the northern city of Tikrit, witnesses in the city and police officials in neighboring Samarra told CNN.
Heavy fighting erupted inside Tikrit -- the hometown of former Iraqi leader Saddam Hussein -- as the military tried to regain control, the sources and a police official in Baghdad said.
According to the witnesses in Tikrit and the Samarra police officials, two police stations in Tikrit were on fire and a military base was taken over by militants, believed to be from the Islamic State of Iraq and Syria, an al Qaeda splinter group also known as ISIS and ISIL.
The governor of Salaheddin province, of which Tikrit is the capital, was missing, according to the Tikrit and Samarra sources.
Suspected ISIS militants raided the Turkish Consulate in Mosul on Wednesday, capturing 48 people, including diplomats. They also seized parts of Baiji, the site of Iraq's largest oil refinery, police officials in Tikrit told CNN earlier.
Mosul: Militants storm Turkish consulate Militants seize Iraqi city of Mosul What's next for Iraq?
Meanwhile, explosions struck three Shiite areas in Baghdad, killing 25 people and injuring 56, police officials told CNN. The deadliest attack was in Sadr City, where a car bomb exploded near a funeral tent, killing 15 people, police said.
The clashes come on the heels of a sudden and danger-fraught exodus from the fighting in Mosul, which fell to militants Tuesday.
More than 500,000 people have fled the fighting there, the International Organization for Migration said Wednesday.
The group said there were many civilian casualties. The city's four main hospitals are inaccessible because of fighting, and some mosques have been converted for use as clinics, the IOM said.
Those fleeing the fighting -- some on foot, some bringing only what they can carry in plastic bags -- were heading to the city's east or seeking sanctuary elsewhere in Nineveh province or in Iraq's Kurdish region.
Mosul, a predominantly Sunni city with 1.6 million residents, collapsed swiftly. American-trained Iraqi forces ran in the face of the onslaught.
The heavily armed radicals overran police stations, freed more than 1,000 prisoners from the city jail and took over the city's international airport.
Iraq's parliamentary speaker was scathing, saying commanders fled and troops left behind weapons and armored vehicles.
Prime Minister Nuri al-Maliki ordered that all military leaders who fled be court-martialed.
The Defense Ministry said the air force killed a group of ISIS militants along a highway leading south toward Samarra. The ministry also said it would push back the militants.
"This is not the end, we are very confident that we will be able to correct the path and to overcome mistakes," the ministry said on its website.
The Interior Ministry said that military commanders have started deploying fighters from local Shiite militias on the western outskirts of al-Nasiriya to protect that city.
Forces from the Kurdistan regional government took up positions in southwest Kirkuk after militants took over several villages and districts north and west of the city and the Iraqi army withdrew, police officials there told CNN.
The Kurdish regional prime minister -- whose ethnic Kurdish forces reach the eastern outskirts of Mosul, capital of Nineveh province -- blamed Iraq's leadership for the city's collapse.
"Over the last two days, we tried extremely hard to establish cooperation with the Iraqi Security Forces in order to protect the city of Mosul. Tragically, Baghdad adopted a position which has prevented the establishment of this cooperation," Nechirvan Barzani said in a statement Tuesday.
Turkish consulate targeted
Turkish special forces members, consulate workers and three children were among those detained and taken to the ISIS headquarters following a raid on the Turkish Consulate in Mosul on Wednesday morning, Turkish officials told CNN.
"The condition of the Turkish citizens is fine, developments are being monitored," the officials said.
Foreign Minister Ahmet Davutoglu said consulate staff had been urged to leave this week, but the decision to evacuate was left up to individuals.
Militants take over Iraqi city Militants take control of Iraqi city Iraq violence leaves more than 100 dead
"We were told that it would be more risky for our 48 people to go outside than to stay inside," Davutoglu said, speaking on Turkish television.
"If any harm is done to any of our citizens, it will not go unanswered. No one should test Turkey."
Oil town under attack
Meanwhile, suspected ISIS militants seized parts of Baiji, a small Iraqi town in Salaheddin province about 200 kilometers (125 miles) north of the capital, Baghdad, police officials in Tikrit told CNN.
The Baiji oil refinery is still under the control of Iraqi security forces, officials said.
The fact that ISIS forces are trying to take the town suggests a wider strategic aim besides oil. Baiji sits on the main highway north from Baghdad to Mosul that passes through rural areas in which ISIS has much influence.
For the government to reinforce its troops in Mosul, it needs to drive them through Baiji. If ISIS controls the town, the government's task will be much harder.
Discontent feeds violence
In his weekly address to the nation Wednesday, al-Maliki described the assault on Mosul as a "conspiracy" to destabilize the country and called on Iraqis to "stand as one united front."
He also praised the people of Nineveh province for volunteering to take up arms against ISIS and promised to "cleanse Nineveh from these terrorists."
A day earlier, the Prime Minister asked parliament to declare a state of emergency, for volunteers to bolster the army, and for help from the international community.
Shiite cleric Muqtada al-Sadr said in a statement Wednesday that he is ready to form a "peace brigade" to work in coordination with the Iraqi government "to defend the holy places" of Muslims and Christians.
But this brigade probably would be viewed by many as a resurgence of al-Sadr's Mahdi Army, the powerful Shia militia that disbanded at the end of 2008.
Its formation could risk worsening the country's underlying problem -- festering sectarian division.
The country's minority Sunni population, which prospered under Hussein, feels shut out by al-Maliki's Shia majority-dominated government.
The devastating ISIS advance is proving an object lesson of much that is wrong in Iraq and the region -- with a festering cινιℓ ωαr over the border in Syria adding fuel to the growing sectarian tensions at home.
ISIS is exploiting this to expand its influence, from cities like Falluja and parts of Ramadi that it wrested from the government in Anbar early this year, and from Syrian towns like Raqqa it controls over the border.
A U.S. counterterrorism official told CNN that ISIS had been active in Nineveh province "for a long time and clearly sensed that Mosul was vulnerable now after engaging in sporadic attacks earlier this year.
"Strategically, the group looks at Syria and Iraq as one interchangeable battlefield, and its ability to shift resources and personnel across the border has measurably strengthened its position in both theaters."
However, the official said ISIS still "has shown little ability to govern effectively, is generally unpopular and has no sway outside the Sunni community in either Iraq or Syria."
Too radical for al Qaeda
The more the Sunnis feel they are being abandoned by their Shia-dominated government, the harder any political rapprochement, and therefore peace, will be.
ISIS is considered too radical even for al Qaeda and in the past months has withstood and emerged from a jihadist backlash from within the ranks of its erstwhile radical Islamist allies in Syria's cινιℓ ωαr.
That it is capable of fighting the forces of Syrian President Bashar al-Assad on one hand, its fellow radicals on another and the Iraqi government on top of that is an indication of the depth to which ISIS has established itself in the region.
Fighting skills
ISIS grew out of al Qaeda in Iraq. In the west of Iraq, its militants were responsible for the deaths and maiming of many U.S. troops. In 2006, their commander -- the bloodthirsty Abu Musab al-Zarqawi -- was killed in a U.S. strike.
In the ensuing years, with American help, Iraqi tribal militias put the al Qaeda offshoot on the defensive.
But when U.S. troops left, the extremist militants found new leadership, grew stronger while in Syria, and returned to Iraq, making military gains often off the backs of foreign fighters drawn to Syria's conflict.
They came to Syria's cινιℓ ωαr better equipped and trained than most jihadists, with skills learned fighting in Iraq. They used their advantage, charting a course directed by a vision for a regional caliphate.
Mosul has not just helped fill their war chest, it has made them the single most dangerous destabilizing radical group in the region -- something the Iraqi government seems ill-equipped to deal with.