Details of the fighting were unclear, but police and an aide to Shia cleric Muqtada al-Sadr said the clash involved US troops and al-Sadr's militia.
Police said the clash erupted after the militia tried to stop US troops from entering the Al-Mustafa Hussainiya Mosque in the Ur district of Baghdad.
US military officials said they had no information about the reported fighting.
Al-Sadr aide, Shaikh Hazin al-Aaraji, speaking to Aljazeera by telephone from Baghdad, said: "Before the maghreb (sunset) prayer, some worshippers called me, saying that US soldiers raided al-Mustafa Hussainiya in the al-Shaab (Ur) neighbourhood and fired at the mosque and then entered it and climbed on to the roof."
"The US forces blocked the roads leading to the mosque," he said, quoting worshippers.
A medic said 18 bodies were found around the mosque.
Another member of al-Sadr's office in Baghdad said US forces made dozens of arrests.
Al-Aaraji said the dead had been unarmed: "The American forces went into Mustafa mosque at prayers and killed more than 20 worshippers... They tied them up and shot them."