* New constitution one last step to full democracy
* Premier Jomaa names new technocrat cabinet
* Tunisia progress contrasts with Egypt, Libya turmoil
By Tarek Amara
TUNIS, Jan 26 (Reuters) - Tunisia's national assembly approved the country's new constitution on Sunday in one of the last steps to establishing full democracy three years after the uprising that toppled autocrat Zine el-Abidine Ben Ali.
Just before the constitution vote, Prime Minister Mehdi Jomaa appointed a caretaker cabinet as part of a deal to end a crisis between Tunisia's Islamist party and its secular opposition until new elections this year.
Tunisia's new constitution and progress contrasts sharply with messy transitions in Libya, Egypt and Yemen which are still caught up in turmoil after ousting their own long-standing leaders in 2011 revolts and uprisings.
After the historic vote, the red and white Tunisian flag was unfurled and assembly deputies embraced, danced and sang inside the chamber in Tunis to celebrate the charter, which has been widely praised for its inclusiveness.
"This constitution was the dream of Tunisians, this constitution is proof of the revival of the revolution, this constitution creates a democratic civil nation," Assembly chief Mustapha Ben Jaafar said.
While the new constitution recognises Islam as the country's religion, it also enshrines freedom of conscience and belief, and equality between the sexes.
As one of the most secular nations in the Arab world, Tunisia has struggled since the revolt, with divisions over the role of Islam and the rise of ultra-conservative Salafists, who secularists feared would try to roll back liberal rights.
The assassination of two opposition leaders by Islamist militants last year, though, pitched the small North African country into crisis with the ruling moderate Islamist party, Ennahda, under pressure to step down.
Opposition leaders blamed Ennahda for going easy on hardline Islamists who promoted the idea of Islamic state based on strict sharia law.
After the vote, in what many saw a symbol of compromise, Mongi Rahoui, a deputy from the assassinated leaders' party, embraced Habib Louz, an Ennahda hardliner. The two men sparred furiously over Islam last week.
"With this, Tunisia should be a model for the region," Ennahda chief Rached Ghannouchi said of the charter. "These advances in democracy in Tunisia should have a positive effect on the other Arab Spring countries."
Such compromise, though, looks difficult elsewhere.
Two years after Muammar Gaddafi was toppled, Libya's congress is deadlocked between Islamists and a nationalist party over the route for transition, a constitution is still undrafted, and former militia fighters run amok.