DILI, East Timor—Two former guerrilla leaders were vying for East Timor's presidency Monday, each hoping to steer the young, often-troubled nation after U.N. peacekeeping troops begin their planned withdrawal later this year.

Francisco "Lu Olo" Guterres and Taur Matan Ruak—running neck-and-neck after incumbent Jose Ramos-Horta was knocked out of the race in the first round of voting—joined small lines forming in the dusty capital, Dili, to cast their ballots.

While the role is largely ceremonial, the new president has the potential to help unify Asia's newest and poorest nation, which is still recovering from its 1999 break for independence following nearly a quarter-century of Indonesian occupation.

Withdrawing Indonesian troops and their militia proxies killed nearly 1,500, and the road to democracy has been anything but easy, with gang violence and splits in the army and police occasionally turning deadly.

After casting his ballot early Monday morning, Ramos-Horta, a Nobel Peace Prize laureate, said the lead-up to Monday's vote was "extraordinarily calm."

The homes of at least two political activists were set on fire during campaigning and rocks were thrown last week at Ruak's headquarters, but the situation was quickly brought under control.

He hoped it would continue that way.

Monday's winner may not have much power, but he has the ability, like Ramos-Horta did, to help lead the country at a crucial time.

Parliamentary elections—to select a new government—will be held on July 7. If peaceful, Australian-led U.N. peacekeepers deployed for more than a decade will start heading home.

Around 700,000 voters were eligible to cast ballots at the country's 650 polling stations Monday.

Lu Olo, the 57-year-old candidate for the opposition Fretilin party, spent nearly half his life fighting Indonesian rule as a commander in East Timor's guerrilla army.

Ruak, 55, running as an independent, also played a key role in the fight.