TUNIS - Tunisia's main secular party was upbeat with the count underway Monday after a general election seen as critical for democracy in the cradle of the Arab Spring.
The first parliamentary election since Tunisia's 2011 revolution pitted Islamist party Ennahda against its main secular rival Nidaa Tounes, with an array of leftist and Islamist groups also taking part.
Analysts predicted no single group would win the outright parliamentary majority needed to govern alone.
But Nida Tounes proudly boasted on its official Facebook page that it had bested its long dominant Islamist rival.
"We won. Long live Tunisia," the party said.
Speaking earlier, party leader Beji Caid Essebsi was slightly more cautious.
"We have positive indications that Nidaa Tounes (Call of Tunisia) could be leading," the 87-year-old veteran of Tunisian politics told reporters.
Several Tunisia media outlets, including Al-Mutawassit television, which is considered close to the Islamists, projected a lead of around 20 seats for Nidaa Tounes.
Ennahda declined to offer a forecast ahead of the official results but its leader Rachid Ghannouchi put the emphasis on consensus.
"Whoever comes out top, Nidaa or Ennahda, the main thing is that Tunisia needs a government of national unity, a political consensus," he told Hannibal television.
"This is the policy that has saved the country from what other Arab Spring countries are going through." The body organising the election could give partial results on Monday, but it has until October 30 to announce the final outcome.
It gave the provisional turnout as 61.8 per cent.
Some 80,000 security forces were deployed to avert extremist attacks on polling day, which passed without major incident, as some three million from an electorate of five million people voted for a 217-seat parliament under a new constitution drafted in January.
US President Barack Obama hailed the vote as "an important milestone in Tunisia's historic political transition".
Tunisia is seen as a beacon of hope compared with other chaos-hit countries like Libya and Egypt, where regimes were also toppled during the Arab Spring of three years ago.
But its transition has been tested by militant attacks and social unrest, while poverty and unemployment, which were key factors that sparked the 2011 revolt, remain unresolved.
The whole campaign was fought on the axis of the economy and security.
La Presse de Tunisie, the country's main French-language newspaper, said the election was a major achievement on the path to establishing stable institutions in the former French colony.
"The mission is almost accomplished, which is considerable," it said in a commentary.
The government had warned of possible jihadist attacks after a standoff on Friday between police and suspected militants near Tunis that killed a policeman and six suspects, five of them women.
Giving a stamp of approval, the head of the EU's election observer mission, Annemie Neyts-Uytterbroeck, said voting had been "more than satisfactory".
An array of parties competed for seats in the new parliament, some fronted by stalwarts of veteran dictator Zine El Abidine Ben Ali who was toppled in 2011.
His ouster ushered in a coalition government and interim president that won international praise. But the birthplace of the Arab Spring protests has flirted with disaster.
A rise in militant activity last year when two opposition lawmakers were assassinated by suspected Islamists - long suppressed under Ben Ali - threatened to derail the road to democracy.
Critics accuse Ennahda and its secular allies, which have been running the country, of failing to address people's security needs or shore up the economy.
Ennahda has proposed the formation of a government of national unity and has not put forward a candidate for a November 23 presidential election, keeping its options open over whom it will back.