Tunis: Islamist party Al Nahda, dominant in Tunisian politics since the 2011 revolution, has won praise for its grace in conceding defeat in landmark parliamentary elections, as the country awaited preliminary results Wednesday.

Just hours after polling stations closed Sunday, Al Nahda acknowledged that it had been beaten into second place by secular rival Nida Tunis.

Al Nahda, which steered the North African nation through the aftermath of the revolution, congratulated Nida Tunis for becoming the largest party in the first parliament to be elected since then.

The movement called on its supporters to celebrate “democracy,” and hundreds of them rallied outside its Tunis headquarters despite the defeat.

“We consider Tunisia has triumphed and that Al Nahda has triumphed by leading the country to this stage,” said Abdul Hamid Jelassi, national coordinator for the movement whose slogan was “consensus” throughout the campaign.

Independent analyst Selim Kharrat, said this has made Al Nahda look like”a very sleek, very democratic party, which congratulates its opponent, which hands over power,” also referring to January, when Al Nahda gave way to a government of technocrats to defuse a political crisis.

Al Nahda, which won Tunisia’s first free elections three years ago after the toppling of longtime president Zine Al Abidine Bin Ali, had previously been accused of working to Islamicise society away from its traditional secularism.

Tunisia’s economy has also been in the doldrums during its tenure, and two prominent figures were assassinated last year by militants, triggering the political crisis that Al Nahda resolved by handing over power.

Analyst Salah Al Din Jourshi said the evolution can be traced back to the Egyptian army’s ouster of Islamist president Mohammad Mursi in July 2013.

“What happened in Egypt shook them up” and led to an easing of strains with Nida Tunis, which includes representatives of the ousted Bin Ali regime whom Al Nahda had initially wanted to ban from running for election, he said.

Analyst Kharrat said this showed Al Nahda’s “extraordinary pragmatism and capacity to adapt” to political developments.

With neither of the two top parties expected to win an outright majority, political horse-trading has begun ahead of the announcement of results.

Election organisers have until Thursday to announce the final outcome.

Projections suggest that Nida Tunis will win around 80 of the 217 seats in parliament, against around 70 for Al Nahda.

Under Tunisia’s electoral system, a party that gains the largest number of votes but falls short of an outright majority is given a mandate to form a coalition government.

Tunisian newspapers on Wednesday predicted a grand coalition.

“The best scenario would be a Nida Tunis-Al Nahda coalition guaranteeing a stable government for the next five years,” said the French-language daily La Presse.

Foreign observers have praised Tunisia’s “free” election, in a vote that has raised hopes of a peaceful transition in the birthplace of the Arab Spring.

However, poverty and unemployment, which were key factors that sparked the anti-Bin Ali revolt, remain unresolved. The election was fought on the axis of the economy and security.