KATMANDU, Nepal - Nepalis voted Thursday in a historic election that was intended to bring communist insurgents into the country's democratic mainstream and will likely end a monarchy that has ruled for centuries.

But violence marred the days preceding the country's first vote in nine years, leaving eight dead, and there were reports of fresh attacks on a candidate and polling stations after voting began.

Voters across the country were undeterred, however, lining up before dawn to cast ballots.

"I came to vote here today believing this process will settle political instability for good," said Mukunda Maraseni, a 40-year-old banker who was waiting to cast his ballot in Katmandu.

The voting is to elect a 601-seat Constituent Assembly, which will govern Nepal and rewrite the country's constitution. It has been touted as the cornerstone of a peace deal struck in 2006 with the Maoists, as the former rebels who fought a decade-long insurgency are known. The deal came after weeks of unrest that forced Nepal's king to end his royal dictatorship.

Security was tight with 17.6 million people in the Himalayan country registered to vote at about 20,000 polling stations, some of them a seven day walk from the nearest paved road. The election was being monitored by some 100,000 observers, including notables such as former President Jimmy Carter.

In the central village of Galkot, Maoists tried to take over a polling station and then torched the building after scuffling with police and election officials, said the area's top official, Bhawani Prashad Parajuli. Police later arrested 15 men, seizing three grenades and a knife.

Maoist officials in Katmandu said they were trying to verify the report, and insisted there was no concerted effort on their part to undermine the election.

Disturbances were also reported in at least four areas of southern Nepal. Gunmen on motorcycles shot at one candidate in Janakpur but she escaped unhurt, said district officer Ram Sharan Chimoiorya.

Voting was suspended at three stations in Chitwan district after an unidentified group kicked ballot boxes, sparking a scuffle among party representatives, said Ratna Raj Pandey, the district officer. Chitwan is a major stronghold of the Maoists.

For many in Nepal, where 60 percent of 27 million people are under 35, it was the first time they had ever voted and there was widespread optimism that the election would finally bring lasting peace and an economic revival to this poor land.

About 35 percent of voters had cast ballots by noon, halfway through the voting, said Home Secretary Umesh Mainali.

"I have come of age never being allowed to choose my government," said 26-year-old Yuvraj Sharma, who works at the Home Ministry. "If the people are heard, we will have peace."

While many here certainly share Sharma's sense of hope, significant challenges remain.

All the major parties, from the Maoists to centrist democrats to hard-core royalists, say they will accept the results, but the violence that has surrounded the election could easily provide a pretext for rejecting the outcome.

Then there is the incredibly complex nature of the vote itself, a mix of direct elections and a nationwide proportional representation system with quotas for women and Nepali's myriad ethnic and caste groups thrown into the mix.

Even electoral experts from the United Nations and other international groups say it will be hard to sort out the results, which are expected by late April or early May.

"The post-poll period will likely be difficult and dangerous," warned the International Crisis Group, a Brussels-based think tank, in a report. "Parties will trade allegations of fraud and violence. ... The behavior of powerful losers will shape the immediate aftermath."

Those powerful losers could include the Maoists, who are expected to place behind Nepal's traditional electoral powers, the centrist Nepal Congress and Communist Party of Nepal (United Marxist-Leninist).

The Maoists have been behind a majority of the election-related violence, the United Nations says, and have 20,000 former fighters camped out across the country with their weapons stored in easily accessible containers under a UN-monitored peace deal.

Observers are also worried about armed minority ethnic groups on the southern plains where fighting twice delayed the vote. The area is now peaceful, but the armed groups have threatened to disrupt the election.

But there is already one man who appears assured to lose in the vote -- King Gyanendra. The major parties have already agreed to abolish the monarchy at the assembly's first sitting.