A double bombing struck at an upscale neighborhood Iraq's capital Tuesday, killing at least 21 even though police stopped three attackers storming a counterterror unit, as the government strained to control al-Qaida-based chaos gripping the country.

The bloody explosions came on the same day that Iraq's government discussed security issues with Iran, a measure of Tehran's growing influence.

Two cars parked in the mostly-Shiite shopping district of Karradah exploded during the afternoon rush hour. Most of the dead were store owners and passers-by, although the blasts hit near two police headquarters and a security checkpoint, killing six policemen.

The bombs sent plumes of black smoke over the neighborhood, located across the Tigris River from the Green Zone, and the sounds of gunshots could be heard from blocks away.

The violence brought the July death toll to 245 people killed in shootings and bombings, approaching the carnage in January, when 255 people were killed following the U.S. pullout.

Al-Qaida has claimed responsibility for nearly all the attacks as it seeks to take advantage of political instability in Iraq and move back into areas it was forced to abandon before the U.S. military left the country last December.

Security forces and government offices are top targets for insurgents seeking to prove how unsafe Iraq remains.

Tuesday's second bomb exploded outside an Iraqi passport office, a few blocks away from the Interior Ministry's major crimes unit headquarters. Fifteen people were killed and 35 wounded, officials said.

Saadoun Hussein was selling cigarettes in a small shop nearby when the roof partially caved in from the second blast. He escaped unharmed.

"I think that terrorists were intending to attack the passport directorate, but failed to reach their target because of the traffic jam," said Hussein, 23.

Police said two suicide bombers and a gunman broke into the crimes unit, which also handles counterterror cases, but they were killed before they could unleash widespread damage.

The Interior Ministry said in a statement that the three aimed to free terror suspects who were being held there. It said three security force members were killed in a shootout. Authorities had control of the situation by Tuesday evening, said Col. Dhia al-Wakil, spokesman for the operations command in Baghdad.

Five minutes earlier, the first bomb went off outside a restaurant at a busy intersection, down the street from a police station and a security checkpoint. Six people were killed and 21 wounded.

Police and health officials confirmed the casualties but spoke on condition of anonymity because they were not authorized to release the information to reporters.

Earlier this month, al-Qaida's leader in Iraq threatened to push back into areas the group was driven out of after sectarian fighting peaked in 2007. A day after al-Qaida issued the threat, shootings and bombings killed 115 people in Iraq's deadliest day in more than two years.

Tuesday's explosions struck as Iraqi officials announced two efforts to make their country safer — and both were linked to Iran.

Iraqi state TV said deputy Interior Minister Adan al-Asadi met in Baghdad with Iran's chief police official to discuss joint efforts to curb smuggling and drug traffic between the two counties. Also Tuesday, Iraqi National Security Adviser Faleh al-Fayadh warned an Iranian exile group to quickly move to a refugee camp on Baghdad's outskirts, or his government will take matters into its own hands.

Al-Fayadh, who called on foreign diplomats to help speed the process, declined to say what would happen if the People's Mujahedeen Organization of Iran refuses to leave Camp Ashraf in northeast Iraq — although he said Iraq's government "is keen on keeping things away from violence and in line with human rights."

Still, "this is the last warning," al-Fayadh said at an almost two-hour-long meeting with foreign diplomats about Ashraf's fate. The exiles ignored a July 20 deadline to leave the camp.

The exile group, also known by its Farsi name, Mujahedeen-e-Khalq, have already moved about 2,000 of its residents to the Baghdad refugee camp, which is a former U.S. military base. The group says it will not transfer its remaining 1,200 members until it sees proof of more water, increased electricity, better facilities for sick and disabled people and other improvements to the base. The U.N. says the services there are already far better than at most other refugee camps worldwide.

The exiles seek the overthrow of Iran's clerical rulers. They have been labeled everything from a cult to a terrorist organization — although one that has provided the U.S. with intelligence on Iran. The group says it renounced violence in 2001, after carrying out bloody bombings and assassinations in Iran in the 1980s.

The Iraqi government considers them a terrorist group that is in the country illegally. Over the last six months, the U.N. has tried to mediate, and helped broker an agreement to close Ashraf and temporarily move the exiles into the refugee camp. Ultimately, Iraqi and U.N. officials want to give the Ashraf residents refugee status and resettle them outside of Iraq.

The distrust between the exiles and Iraq's government has always been palatable, but it peaked after security forces led deadly raids in Ashraf twice in the last four years.

"The government of Iraq receives all of its orders on Ashraf from the Iranian regime, refrains from implementing this simple and practical plan, and it's planning for the third massacre at Ashraf," the exiles said in a statement Tuesday.

The top U.N. envoy in Iraq urged Ashraf residents to prepare to move.

"Today I heard the government say it will not use violence," U.N. envoy Martin Kobler said after the meeting with al-Fayadh. "That is very important. But I am in favor of a rapid move, and for the residents to start preparing for it right away."