BAGHDAD — Islamic militants Tuesday attacked areas in central Baqouba, a city just 30 miles northeast of Iraq's capital Baghdad, but were pushed back by security forces and tribal fighters.
In one incident, at least 44 Sunni prisoners died in an apparent foiled rescue attempt by Sunni Muslim militants from the al-Qaeda breakaway group known as Islamic State of Iraq and the Levant — referred to as ISIL or ISIS. The Levant is a traditional name for the region including Iraq and greater Syria.
The fighting is the closest yet to Baghdad following lightning offensives that have seen Sunni extremists take large swaths of territory in the north of the country over the past week. The militants say they intend to march on Baghdad and the southern Shiite holy city of Karbala.
IRAQ CRISIS: What you need to know
In the clash that left several dozen Sunni prisoners dead, militants stormed a police station in Baqouba, the capital of Diyala province, in a reported attempt to free the prisoners. There were conflicting accounts over who was responsible for the killings — the attackers themselves or Iraqi security forces.
Meanwhile, residents said many took up arms against the insurgents.
MORE: Major players in Iraq
VOICES: Taking the long view on Iraq
"When the attack started I took my weapon as many people in my area came out and shot the insurgents," said Nameer al Baiati, a professor at Diyala University. "There were around 100 fighters most of them shooting with heavy weapons."
No fighting has occurred in the city since the attack was halted, according to locals. "The city is back to normal," said Ali al Saadi, a lawyer in Baqouba.
Still, in the past 24 hours Iraqi security forces killed 56 militants and wounded 21 just outside the capital during clashes with ISIL forces, said Interior Ministry spokesman Brig. Gen. Saad Maan Ibrahim.
In the strategic city of Tal Afar near the Syrian border, militants were reportedly in control of most of the town, but pockets of resistance remain with soldiers, policemen and armed residents holding onto the city airport, according to Nineveh provincial council Deputy Chief Nureddin Qabalan.
Iraqi Gen. Abu Al Waleed, however, contested the reports that militants had seized the town, saying his troops were still fighting.
"I will tell the Iraqi people very happy news very soon," said Al Waleed. "We recovered most of the parts of Tal Afar."
In another incident Tuesday, gunmen took control of the western Iraqi town of Al-Qaim, near the border crossing with Syria.
The latest violence comes as both Iran and the United States deepen their involvement in the conflict, with the commander of Tehran's elite Quds Force providing assistance to the Iraqi military and the U.S. beefing up security at its embassy in the capital.
The ISIL's vow to march to Baghdad, then south to the Shiite holy cities of Karbala and Najaf, mark the worst threat to Iraq's stability since U.S. troops withdrew in 2011.
The White House insisted Monday that the U.S. would not be sending combat troops to Iraq, but is deploying up to 275 military troops to protect the U.S. Embassy and other American interests and is considering sending a contingent of special forces soldiers.
Some embassy staff have been moved elsewhere in Iraq and to neighboring Jordan, the State Department said.
President Obama, who notified Congress of the deployment on Monday under the requirements of the War Powers Resolution, said the troops are equipped for combat and will remain in Iraq until the security situation becomes such that they are no longer needed.
Secretary of State John Kerry said Monday that the U.S. is willing to talk with Iran to stem the advance by extremists and would not rule out possible military cooperation with the longtime enemy.
But the Pentagon quickly underscored that Washington would not be consulting with Iran on any potential military intervention. "We are not planning to engage with Iran on military activities inside Iraq," said Rear Adm. John Kirby, the Pentagon spokesman.
Neighboring Iran, which backs the Shiite-led government of President Nouri al-Maliki, the besieged prime minister, is also staking out a higher profile as the security situation deteriorates.
Iranian Gen. Ghasem Soleimani, commander of Tehran's elite Quds Force, has been consulting in Iraq on how to roll back the militant onslaught.
In another sign of closer cooperation between Tehran and the West, British Foreign Secretary William Hague told Parliament Tuesday that Britain would reopen its embassy in Tehran following an improvement in bilateral relations in recent months. Hague said the "circumstances were right" to improve ties.
Despite impressive gains in recent days, Sunni insurgents are not likely strong enough to take over Iraq's Shiite south, said Reuel Marc Gerecht, a former CIA operations officer who now works at the Foundation for Defense of Democracies.
"Iraq's military has more than enough in its home terrain to prevent Sunni militants to make inroads," Gerecht said.
Collins reported from Berlin. Contributing: Oren Dorell in McLean, Va., and the Associated Press