TRIPOLI, Libya – Jubilant Libyans chose a new parliament Saturday in their first nationwide vote in decades, but violence and protests in the restive east underscored the challenges ahead. The oil-rich North African nation is struggling to restore stability after the ouster of longtime dictator Moammar Gadhafi.

One person was killed and two wounded in a gun battle between security forces and anti-election protesters in the eastern city of Ajdabiya, according to the head of the election commission. Nouri al-Abari said the polling center targeted by the protesters was later reopened and voting commenced normally.

The shooting followed a spate of attacks on polling centers in the eastern half of the country, which was the cradle of the revolution against Gadhafi but has become increasingly angry over the perceived domination of power by rivals in Tripoli.

VOTERS LINE UP EARLY

The vote capped a chaotic transition that has exposed major fault lines ranging from the east-west divide to efforts by Islamists to assert power.

Lines formed outside polling centers more than an hour before they opened in the capital Tripoli, with policemen and soldiers standing guard and searching voters and election workers before they entered.

“I have a strange but beautiful feeling today,” dentist Adam Thabet said as he waited to cast a ballot. “We are free at last after years of fear. We knew this day would come, but we were afraid it would take a lot longer.”

The election for a 200-seat parliament, which will be charged with forming a new government, was a key milestone after a bitter civil war that ended Gadhafi’s four-decade rule. It was the first time Libyans have voted for a parliament since 1964, five years before Gadhafi’s military coup that toppled the monarchy.

But the desert nation of 6 million people has fallen into turmoil since Gadhafi was killed by rebel forces in his home city of Sirte in late October. Armed militias operate independently, refusing to be brought under the umbrella of a national army, and deepening regional and tribal divisions erupt into violence with alarming frequency.

Growing resentment in the east and the inability to rein in unruly militias have threatened to tear the country apart.

Some easterners boycotted the election and protesters torched ballot boxes in 14 out of 19 polling centers in Ajdabiya, said Ibrahim Fayed, a former rebel commander in the area.

HELICOPTER SHOT DOWN

On the eve of the vote, gunmen shot down a helicopter carrying polling materials near the eastern city of Benghazi, birthplace of last year’s revolution, killing one election worker on board, said Saleh Darhoub, a spokesman for the ruling National Transitional Council. The crew survived after a crash landing.

The violence continued Saturday, with protesters, some armed, attacking polling centers in the early hours in the eastern cities of Ajdabiya, Brega and Ras Lanouf, ransacking them and setting ballot papers ablaze.

Reflecting the lawlessness that has plagued the country since Gadhafi’s ouster, protesters attacked a polling station in Benghazi only to be driven back by voters who fired their own weapons in the air, independent candidate Faiza Ali said.

“Enough with the bloodshed,” she said.

Nouri al-Abar, the head of the election commission, told reporters in Tripoli that 94 percent of polling centers nationwide were open but acknowledged that “security conditions” prevented ballots from reaching some areas and ballots were destroyed in other cases. He did not provide further details.

The uprising against Gadhafi was inspired by the Arab Spring revolts that led to the ouster of authoritarian leaders in Tunisia, Egypt and later Yemen. But it morphed into outright civil war as armed rebels backed by NATO airstrikes battled Libyan regime forces for months.

Islamist parties also have gained influence in Libya and other nations following the ouster of authoritarian regimes run by strongmen like Gadhafi and Egypt’s Hosni Mubarak.

There are four major contenders in the Libyan race, ranging from the Muslim Brotherhood-linked party and another Islamist coalition on one end of the spectrum to a secular-minded party led by a Western-educated former rebel prime minister on the other.

A MOOD OF TRIUMPH

Despite the divisions and unrest, the prevailing mood was one of triumph.

“We are celebrating today and we want the whole world to celebrate with us,” Prime Minister Abdurrahim el-Keib said after he cast his ballot in Tripoli.

Voters flashed the V-for-victory sign as they entered polling centers. Motorists honked their horns as they drove past. Others shouted “Allahu Akbar,” or “God is great,” from their car windows.

“This is history in the making,” 26-year-old medic Farid Fadil said. “We were ruled by a man who saw himself as the state.”