A homicide bomber blew himself up among worshippers waiting to be searched outside a mosque run by followers of anti-American Shiite cleric Muqtada al-Sadr on Friday, killing at least 12 people, Iraqi officials said.

The blast in Musayyib, south of Baghdad, occurred a day after Iraqi lawmakers approved a security pact with the United States that will allow U.S. forces to stay in Iraq for three more years.

Proponents of the deal, which awaits the expected ratification by the three-member presidency, say the Americans are still needed because Iraqi forces aren't ready to take over security on their own despite a sharp drop in violence since last year.

The U.S. military handed responsibility for security in Babil province, where the homicide bombing occurred Friday, to Iraqi forces last month.

The security pact was backed by the ruling coalition's Shiite and Kurdish blocs and the largest Sunni Arab bloc, which wanted concessions for supporting the deal. But al-Sadr, who commands a 30-seat bloc in the 275-seat parliament, rejected the pact and said U.S. troops should withdraw immediately.

A key aide to al-Sadr linked Friday's bombing to the agreement and warned that the American presence can only to more violence. He appeared to be suggesting that U.S. forces are a source of instability, rather than part of the solution to the Iraqi conflict.

"The explosion that took place today near a Shiite mosque in Musayyib town is one of the consequences of the security agreement," Sheik Abdul-Hadi Al-Mohammadawi said during a sermon in the Sadrist stronghold of Kufa. "The Iraqi government cannot survive without the U.S. presence and as long as the Americans remain here, Iraq will be still a battlefield."

Al-Sadr called for peaceful protests and urged followers to close his offices and affiliated institutions for three days to show opposition to the pact, according to the statement read by his spokesman, Sheik Salah al-Obeidi.

"We offer our condolences to the Iraqi people over this calamity that has fallen upon them with the signing of the agreement of humiliation and indignity," the statement said.

Hundreds of al-Sadr's supporters demonstrated against the pact in Sadr City in eastern Baghdad, a stronghold of the cleric.

A cease-fire order by the Shiite cleric, who is believed to be in Iran, has been a key factor in the drop in violence over the past year. His militia had also been heavily targeted in U.S. and Iraqi operations.

In the southern city of Najaf, a Shiite cleric whose political party backed the security agreement disputed claims that Iraq was forced to accept the pact against its will.

"The approval of the security agreement was an Iraqi decision free of any external pressure and it was done through accord among Shiites, Sunni Arabs and Kurds," said cleric Sadralddin al-Qubanji, a member of Iraq's largest Shiite political party, the Supreme Islamic Iraqi Council.

In Tehran, a hard-line Iranian cleric said the Iraqi parliament approved the deal under U.S. pressure but "did well" in deciding to put it to a referendum. The cleric, Ayatollah Ahmad Jannati, was referring to the decision by Iraq's Shiite bloc to agree to a Sunni demand that the pact be put to a nationwide referendum by July 30.

Jannati's measured remarks were a departure from the harsh criticism that Iranian authorities had leveled against the security pact while it was being negotiated, though they tempered their criticism as the pact moved toward approval by Iraqi lawmakers.

In the bombing Friday, the attacker detonated his explosives belt around noon as he waited in a line to be searched at an entrance to the mosque in Musayyib, 40 miles south of Baghdad, a police officer said on condition of anonymity because of security concerns.

Dr. Saad al-Janabi of the local hospital said 12 people died and 18 people were wounded. The police officer earlier said 11 people died, but al-Janabi said one of the injured died in the hospital.

The U.S. military said eight civilians were killed and 15 wounded.

Mahdi Rajab, owner of a nearby grocery store, said the force of the blast shattered windows.

"I went outside to see what happened and I saw dead bodies at the entrance of the mosque and worshippers were running away in panic," he said.

There was no claim of responsibility, but homicide bombings are associated with Sunni extremist groups. The U.S. military has warned Sunni insurgents are trying to provoke revenge attacks by Shiites in order to reignite sectarian warfare.

Under the security pact, U.S. forces will withdraw from Iraqi towns and cities by June 30 and the entire country by Jan. 1, 2012. Iraq will have strict oversight over the nearly 150,000 American troops now on the ground, representing a step toward full sovereignty for Iraq.