"They were carrying Kalashnikovs, hand grenades. One of them blew himself up and the others were killed by the security forces," the head of the central Euphrates operations command, Qais Khalaf, said.
A member of the local council and a source at the provincial health directorate confirmed the death toll in the attack, which took place late on Sunday, and said at least 26 people were also wounded.
There was no immediate claim of responsibility for the attack but all recent suicide operations in Iraq have been claimed by the Islamic State (ISIS , ISIL , IS and Daesh) terrorist group.
Ain al-Tamer is located about 50 kilometres (30 miles) west of the holy Shiite city of Karbala and lies on the edge of the province of Anbar.
Officials said the attackers started opening fire in a neighbourhood of Ain al-Tamer at around 1830 GMT on Sunday, although it was not immediately what their target was.
Five members of a same family were among the dead, according to a health official from Karbala province.
The military commanders said the attackers came from the Anbar desert to the west.
Karbala lies on the edge of the sprawling province of Anbar, which is overwhelmingly Sunni and has borders with Saudi Arabia, Jordan and Syria, AFP reports.
12