KABUL -- Afghanistan's first parliamentary elections in eight years suffered from violence and chaos Saturday, with a multitude of attacks killing at least 36 people, key election workers failing to show up and many polling stations staying open hours later than scheduled to handle long lines of voters.

Problems surrounding the elections -- already three years overdue -- threaten to compromise the credibility of polls which an independent monitoring group said were also marred by incidences of ballot stuffing and intimidation by armed men affiliated with candidates in 19 of the country's 32 provinces. Some areas have yet to vote, including Kandahar, where the provincial police chief was gunned down Thursday.

Stakes were high in these elections for Afghans who hoped to reform Parliament, challenging the dominance of warlords and the politically corrupt and replacing them with a younger, more educated generation of politicians. They were also high for the U.S., which is still seeking an exit strategy after 17 years of a war there that has cost more than $900 billion and claimed more than 2,400 U.S. service personnel.

Deputy Interior Minister Akhtar Mohammed Ibrahimi said 36 people were killed in 193 insurgent attacks across the country: 27 civilians, eight police officers and one Afghan soldier. He said attackers used everything from grenades to small arms fire to mortars and rocket launchers, and that security forces killed 31 insurgents.

The most serious attack on the polls was in a northern Kabul neighbourhood where a suicide bomber blew himself up just as voting was about to end, killing three people and wounding another 20, many of them seriously, said Dr. Esa Hashemi, a physician at the nearby Afghan Hospital. Interior and defence ministry officials said 15 people were killed or wounded, including several police.

Polling stations also struggled with voter registration and a new biometric system that was aimed at stemming fraud, but instead created enormous confusion because many of those trained on the system did not show up for work. Also, the biometric machines were received just a month before polls and there was no time to do field testing.

Many polling stations opened as much as five hours behind schedule. The Independent Election Commission was uncertain how many of the estimated 21,000 polling stations closed by 4 p.m. local time, the original closing time. Polling was extended until 8 p.m. local time for all those polling stations that opened late, and those that could not open before 1 p.m. local time will open Sunday.

Afghanistan's deputy chief executive Mohammad Mohaqiq expressed outrage at the chaotic start to polling and assailed election preparation by the country's election commission.

"The people rushed like a flood to the polling stations, but the election commission employees were not present, and in some cases they were there but there were no electoral materials and in most cases the biometric systems was not working," he said.

"The widespread reports today of confusion and incompetence in the administration of the elections ... suggest that bureaucratic failures and lack of political will to prioritize organizing credible parliamentary elections may do more to delegitimize the election results than threats and violent attacks by the Taliban and Daesh," said Andrew Wilder, vice-president of Asia Programs at the U.S. Institute of Peace, using the Arabic acronym name for the Islamic State group.

Afghan President Ashraf Ghani marked his ballot at the start of voting. In a televised speech afterward, he congratulated Afghans on another election and praised the security forces, particularly the air force, for getting ballots to Afghanistan's remotest corners.

"I thank you from the bottom of my heart," he said, also reminding those elected that they are there to serve the people and ensure the rule of law.

North of Kabul, thousands of outraged voters blocked a road after waiting more than five hours for a polling station to open, said Mohammad Azim, the governor of Qarabagh district where the demonstration took place.

Election Commission Commissioner Abdul Badi Sayat said dozens of teachers who had been trained in the new biometric system had not shown up for work at the polling stations. It wasn't clear whether that was related to a Taliban warning directed specifically at teachers and students telling them to stay away from the polls.

"The long lines at many polling stations today, despite the threats and violent attacks by the Taliban and Daesh, clearly demonstrate that the problem with Afghan elections is not the enthusiasm of Afghan voters for a democratic future," said Wilder.

The Defence Ministry said it had increased its deployment of National Security Forces to 70,000 from the original 50,000 to protect polling stations.

Elections in the provinces of Kandahar and Ghazni have been delayed as well as in 11 of the country's nearly 400 districts.

The Independent Election Commission registered 8.8 million people. Wasima Badghisy, a commission member, called voters "very, very brave" and said a turnout of 5 million would be a success.

At a polling station in crowded west Kabul, Khoda Baksh said he arrived nearly two hours early to cast his vote, dismissing Taliban threats of violence.

"We don't care about their threats. The Taliban are threatening us all the time," said 55-year-old Baksh, who said he wanted to see a new generation of politicians take power in Afghanistan's 249-seat Parliament. He bemoaned the current Parliament dominated by warlords and corrupt elite. "They have done zero for us."

In the run-up to the elections, two candidates were killed while polling in Kandahar was delayed for a week after a rogue guard gunned down the powerful provincial police chief, Gen. Abdul Raziq. In the capital of Kabul, security was tight, with police and military personnel stopping vehicles at dozens of checkpoints throughout the congested city.

Commission deputy spokesman Aziz Ibrahimi said results of Saturday's voting will not be released before mid-November and final results will not be out until later in December.