(CNN) -- With a backdrop of rapidly growing violence, Iraqis voted Wednesday in their first nationwide polls since the 2011 withdrawal of U.S. forces.
More than 12 million Iraqis braved potential threats and went to the polls, for a voter turnout of 60%, Iraq's election commission said.
Prime Minister Nuri al-Maliki is battling for a third term in office, but faces fierce opposition, with sectarian bloodshed at its most intense in more than five years.
Polls closed at 6 p.m. local tim (11 a.m. ET), and the ballot-counting process began. Results are expected in 20 to 30 days.
At least seven people were killed in attacks targeting polling stations.
"The terrorists warned that the elections will not take place and they threatened the Iraqi people who challenged them back," al-Maliki said after casting his vote. "They launched attacks and many Iraqis were martyred, but our people didn't stop going to cast the ballots."
He urged all voters to cast their ballots to send a message to doubters.
"We expect unprecedented turnout so we can move Iraq ahead in the political and democratic process," he said.
One of the attacks Wednesday came in Khanaqin, northeast of Baghdad, where three died and dozens were wounded when a suicide bomber targeted a polling station, security sources told CNN.
An Iraqi soldier was killed and nine others were injured in an attack by a suicide bomber on a polling station in Baiji, authorities in Tikrit told CNN. A policeman also was killed in a separate incident involving a suicide bomber in Baiji, authorities in Tikrit told Iraqiya TV.
And in Diblis, near the northern city of Kirkuk, two women were killed by a roadside bomb while heading to their polling station, according to security sources.
A suicide bomber was killed by the Iraqi army as he tried to enter a polling station near Mosul, security forces said. Two police officers were injured.
Bombers dressed in uniforms
On Tuesday, the officials charged with protecting polling stations and voters on election day came under attack themselves.
Suicide bombers dressed in police and army uniforms placed themselves among the security officials lined up to cast their ballots, then detonated explosives. Dozens of people were killed and injured across the country.
Those attacks, as well as a number Monday, were an apparent attempt to derail the balloting process and discourage the rest of Iraq's 21.5 million registered voters from going to the polls.
With a surge in car bombings, assassinations and suicide attacks, the vote -- the fourth national election since the fall of longtime leader Saddam Hussein in 2003 -- is being held amid rapidly growing violence reaching levels not seen in more than five years.
Iraq has been beset with political and sectarian violence for months, often pitting Sunnis -- a minority in Iraq -- against Shiite Muslims, who came to dominate the government after Saddam Hussein was overthrown in 2003.
The United Nations said 2013 was the deadliest year in Iraq since 2008, with more than 8,800 people killed, most of them civilians.
Tensions continue to be fueled by widespread discontent among the Sunnis, who say they are marginalized by the Shiite-led government and unfairly targeted by heavy-handed security tactics.
Sunni anger has made it easier for al Qaeda-linked militants to recruit and operate while eroding the public's cooperation with security forces.
Iraq's security forces, trained by the United States at a cost of billions of dollars, have been unable to dislodge the militants and instead are fighting pitched battles.
Sunni militants in Iraq have collaborated with their co-religionists who are fighting to oust Syrian President Bashar al-Assad.
Other endemic problems gripping the country include high unemployment levels, dilapidated infrastructure and services, and chronic corruption. Oil revenues have failed to improve the lives of most Iraqis.
The dire security situation in which the elections are being held is reminiscent of the country's first post-Hussein elections in 2005, when threats from al Qaeda insurgents led to minimal turnouts in most Sunni provinces.
The voting has been canceled in parts of Anbar province, controlled by jihadists and tribesmen.
Following the last parliamentary election in 2010, it took nearly eight months of intense backdoor negotiations for Iraq's bickering politicians finally to form a government.
This time, though, there are no U.S. forces on the ground, and Washington will be watching from afar.
CNN's Salma Abdelaziz, Joe Sterling and Arwa Damon contributed to this report.