w-iraq-election-violence-cp-8269484

Women walk past the rubble of a house destroyed by a blast in the mixed neighbourhood of Kirayaat, where police say one person died. ((Hadi Mizban/Associated Press))

Voters in Iraq cast ballots in parliamentary elections Sunday despite a series of deadly insurgent attacks that began shortly after polls opened.

More than 30 people died in mortar, grenade and car-bomb attacks across the country. The victims included at least 14 people who were killed in attacks in the capital, Baghdad.

Dozens of firefighters and civil defence workers were trying to reach victims of one of the attacks in the strongly Shia neighbourhood of Shaab in Baghdad's north end, where extremists blew up a building, killing at least seven people.

"We all heard clearly a little girl crying in the ruins," said John Simpson, reporting from the scene for the BBC. "Stories of what happened vary greatly, but it seems most likely that Sunni extremists put bombs here, perhaps car bombs, as part of the campaign against the election."

In the city's northeast Hurriyah neighbourhood, where mosque loudspeakers exhorted people to vote as "arrows to the enemies' chest," three people were killed when someone threw a hand grenade at a crowd heading to the polls, said police and hospital officials.

Mortars rained down in the predominantly Sunni neighbourhood of Azamiyah in northern Baghdad and were also launched toward the Green Zone, home to the U.S. Embassy and Prime Minister Nouri al-Maliki's office.

Sunni Islamist militants had vowed to stop the vote for the country's second full-term parliament since the 2003 U.S. invasion.

Al-Maliki faces Shia groups

This election is considered pivotal as Iraq prepares for the departure of U.S. troops next year, a test of whether Iraq can overcome the sectarian divisions that have defined it since the invasion.

U.S. President Barack Obama said in an earlier statement: "I have great respect for the millions of Iraqis who refused to be deterred by acts of violence, and who exercised their right to vote today. Their participation demonstrates that the Iraqi people have chosen to shape their future through the political process."

Al-Maliki is fighting for his political future with challenges from a coalition of mainly Shia religious groups on one side and a secular alliance combining Shia and Sunnis on the other.

Almost 20 million voters were eligible to cast ballots. About 6,200 candidates competed for 325 seats in the new parliament. The polls closed at 5 p.m. local time, and official results aren't expected for days. 

Once the vote outcome is known, U.S. officials expect it will take months for the new parliament to select the next prime minister, who will then choose the new government.

The prime minister has built his reputation as the man who restored order to the country, but he's facing a tough battle from his former Shia allies, the Supreme Islamic Iraqi Council and a party headed by anti-American cleric Muqtada al-Sadr.

He also faces a challenge from a secular alliance led by Ayad Allawi, a former prime minister and secular Shia, who has teamed up with a number of Sunnis in a bid to claim the government.

With files from The Associated Press