Tunisia's moderate Islamist Ennahda party has won the country's first democratic elections after the Arab Spring uprisings, officials say.
Official results show Ennahda won more than 41% of the vote, securing 90 seats in the 217-member parliament.
Ennahda has already said it wants to form a new government within a month.
Violent protests broke out in the central town of Sidi Bouzid after the election results were announced, witnesses say.
Reports say police used tear gas to disperse hundreds of people. They were protesting against the cancellation of seats won by the Popular List party in six electoral districts because of "financial irregularities".
The Popular List party, led by a businessman, had won a number of seats in Sidi Bouzid.
The town is the birthplace of the uprising that erupted nine months ago, after a young unemployed man set himself on fire. The uprising led to President Zine el-Abidine Ben Ali being thrown out of office.
Tunisia's election chief Kamel Jandoubi presented the results of last Sunday's poll at a news conference in Tunis on Thursday night.
Mr Jandoubi said that the Congress for the Republic (CPR) - the country's biggest secularist party - was the runner-up in the elections with nearly 14%, winning 30 seats in parliament.
The leftist Ettakatol party came third with almost 10%, giving them 21 seats.
Ennahda, which was banned under the former regime, says it has modelled itself on the governing AK party in Turkey, another Muslim-majority country which has remained a secular state.
Party leader Rachid Ghannouchi pledged on Thursday the rights of every Tunisian would be protected by the new authorities.
"We will continue this revolution to realise its aims of a Tunisia that is free, independent, developing and prosperous, in which the rights of God, the Prophet, women, men, the religious and the non-religious are assured because Tunisia is for everyone," Mr Ghannouchi told a crowd of supporters, Reuters reports.
Ennahda has sought to reassure secularists and investors, nervous about the prospect of Islamists holding power in one of the Arab world's most liberal countries, by saying it would not ban alcohol, stop tourists wearing bikinis on the beaches or impose Islamic banking.
Foreign tourism is a major source of revenue for Tunisia.
But despite the reassurances, Ennahda's victory is causing concern in some parts of Tunisia, who fear the party could later change their policies, the BBC's Chloe Arnold reports.
Ennahda has put forward its number two, Secretary General Hamadi Jebali, as the next prime minister. Coalition talks with the CPR and Ettakatol parties have already begun.
Mr Jebali, 62, is an engineer by training and a former journalist. He was a co-founder of Ennahda.
The polls were Tunisia's first democratic elections, and followed the fall of President Ben Ali, who was overthrown in January after mass demonstrations. He had been in power for 23 years.
Unlike its eastern neighbour Libya, Tunisia's transition from authoritarian rule has been largely peaceful.