(Corrects number of parliamentary seats to 328 in fifth paragraph, corrects spelling of prime minister's name in first paragraph)
By Ned Parker
BAGHDAD, April 30 (Reuters) - Iraqis head to the polls on Wednesday in their first national election since U.S. forces withdrew from Iraq in 2011 as Prime Minister Nuri al-Maliki seeks a third term amid rising violence.
The country's western province of Anbar is awash in violence as Sunni Muslim militants challenge the Iraqi military and Shi'ite militias for territory surrounding Baghdad.
The country's economy is struggling and Maliki faces criticism that he is aggravating sectarian splits and trying to consolidate power for political gain.
On Wednesday voters choose among 9,012 candidates and the parliamentary election effectively serves as a referendum on Maliki, a Shi'ite Muslim who has governed eight years.
Political analysts say no party is likely to win a majority in the 328-seat parliament and forming a government may be hard even if Maliki's State of Law alliance, as expected, wins the biggest number of seats.
Maliki, who is fending off challenges from Shi'ite and Sunni rivals, has portrayed himself as his Shi'ite community's defender against the Sunni Islamic State of Iraq and the Levant.
This week, Maliki vowed to stop the al Qaeda inspired ISIL from entering Baghdad.
"Is ISIL and al Qaeda capable of reaching the target for they were established ... bringing down Baghdad and the other provinces and destroying the holy shrines? ... I say no," Maliki said.
"ISIL is over, but its pockets still exist and we will keep chasing them and the few coming days will witness major developments."
His forces are currently locked in a four-month fight for the cities of Ramadi and Fallujah in Anbar. His troops surround Fallujah and are waging street battles in Ramadi. The war has displaced an estimated 420,000 people and the Iraqi electoral commission concedes it can only hold the election in 70 percent of Anbar, not counting Fallujah.
On Monday 50 people were killed in attacks around Iraq, with some suicide bombers dressed in police and army uniforms. The burden falls particularly hard on Iraq's Sunni population, who are viewed with suspicion by the mostly Shi'ite Iraqi security forces and terrorized by the ISIL.
Iraq's Sunni political leaders paint Maliki as an authoritarian ruler who wants to destroy their community. His main Sunni nemesis, the parliament speaker Usama al-Nujaifi, criticized the prime minister this week.
"Our people haven't harvested the national partnership only the rattle of weapon, the language of blood, the education of revenge, the sectarian inciting, the displaced people as a result of terrorism and militias," Nujaifi told supporters recently.
He worried a third term for Maliki would be "an allowance for massacres committed against innocent people."
TEST OF DEMOCRACY
The coming period will be a test of Iraq's democracy. It took nine months to seat a government after the last national election in 2010. That competition took place with tens of thousands of U.S. soldiers in the country.
This time, Shi'ite, Sunni and Kurdish parties are outspoken about their wish for Maliki to go, but Maliki is still expected to perform better than the others.
Some warn this time the government formation process could take a year. The negotiations will take place with intense fighting occurring around the edges of Baghdad and Anbar, injecting an element of instability into the proceedings.
In contrast to prior national unity governments, Maliki is expected to seek a stronger coalition built around a majority government.
Some voters still love Maliki and see him as their savior. "Maliki is still the strong man who hit al Qaeda inside their den of Anbar and the majority Shi'ites look to him as their savior from Sunni domination and terrorism. He's the man for tough jobs," said Safadin Murib, a government employee from Hilla.
Others have lost faith in the whole political process even if they planned to vote. "I haven't benefited from the previous elections and am not expecting to benefit now," said Thamir Muhammad Jassim, a shopkeeper in Hilla, south of Baghdad. (Reporting By Ned Parker, Ahmed Rasheed and Raheem Salman; Editing by Cynthia Osterman)