Official results from Tunisia show the Islamist Ennahda party has failed to win the second free election since the uprising in 2011.
Ennahda, which had handed power to a government of technocrats pending the elections, lost out to the secular party Nidaa Tounes in a relatively peaceful poll that offers some hope in a volatile region.
Members of Tunisia's Independent Election Commission marked the release of the official results Thursday, four days after the polls closed, with a rendition of the national anthem. Nidaa Tounes won 85 of the 217 parliamentary seats, and Ennahda took 69.
The results were in line with expectations, said Fatima El Issawi of the Middle East Center at the London School of Economics.
"It is a vote for stability; it is a vote for experienced people that can run a country smoothly with experience," El Issawi said. "There is fear of the return of major faces and figures that used to be part of the old regime."
Nidaa Tounes is led by veteran politician Beji Caid el Sebsi, 87. He served under dictator Zine El Abidine Ben Ali, who was ousted in the 2011 revolution, and he held various Cabinet positions under Ben Ali's predecessor, Habib Bourguiba.
El Sebsi is a front-runner for the presidential election, set for November 23. Ennahda has chosen not to enter a presidential candidate.
Ennahda lawmaker Ali Larayedh, a former prime minister, tried to rally deflated supporters at a rally in Tunis, telling them that Ennahda was still one of the nation's biggest parties and was still the best guarantee for democracy and freedom.
"We are a deep-rooted political party; we are still going forward. Do not be afraid," he said.
The election results have sparked heated debate on the streets of Tunis about what the future holds and where Ennahda went wrong. One resident said she didn't know whether Nidaa Tounes "will be any good, but the people of Tunisia had a bad reaction to Ennahda."
That reaction was prompted partly by Ennahda's perceived failure to improve the economy, but mostly by the worsening security situation, said El Issawi.
"Their policies were perceived as largely lax in dealing with jihadists as a security threat," she said. "We witnessed two political assassinations in one year."
That security threat was underlined on the eve of the election when six people were killed as security forces stormed a suspected Islamist militant hideout.
The challenges ahead are considerable. Without an outright majority, Nidaa Tounes is in talks with rival parties on forming a government.
"We are not sure whether [Nidaa Tounes] would go for a coalition with Ennahda," El Issawi said. "And I think this is unlikely. The second choice would be to form a coalition with smaller leftist parties. And the third choice would be to continue with a government of technocrats."
Political observers said early indications suggested that Nidaa Tounes might wait until the results of the presidential election next month before finalizing a government.