The remarkable political journey of the 41-year-old leader started at John Moores University in Liverpool in 1984 where he read maritime studies. After graduating with a Bachelor of Arts degree in 1989 he returned to the Maldives and became a very vocal critic of President Maumoon Addul Gayoom, who had then been in power for 13 years.
In 1991 Anni was jailed and made an Amnesty International "prisoner of conscience" for writing for the popular political magazine Sangu. It was to be the first of 13 occasions when he was jailed for showing open dissent to Mr Gayoom's autocratic regime, on one occasion claiming he was so badly beaten that he now walks with a limp.
In 2000 Anni was elected as a representative of the capital Male in the People's Majlis, or parliament, and this soon became his power base.
Six months later, in 2001 he was tried and sentenced to two and half years in prison for the theft of unspecified "government property". On his release he fled the Maldives and in November 2003 joined with Mohamed Latheef to form the Maldivian Democratic Party while in exile in Sri Lanka.
In the same year a political prisoner, Hassan Evan Nassem, died in custody at the hands of the security forces causing waves of protest across the islands and a chorus of criticism abroad.
This hugely increased the pressure on Mr Gayoom to progress with democratic reforms, especially after Mr Nasheed was granted political asylum by the British Government the following year.
After about 18 months in self-proclaimed exile when he forged close ties to Britain's Conservative party, he returned to Male in April 2005 to a hero's welcome. When political parties were finally declared legal in June he built a network of support across the archipelago with branches on nearly all the 200 inhabitated islands.
In August 2005, he was arrested again during a sit in to mark the second anniversary of Black Friday, the violent putting down of a peaceful protest in the Male the previous year. He was charged with terrorism and his arrest again provoked huge unrest and civil disobedience. However, by now Mr Gayoom's grip on the Maldives was weakening and in the same year he finally agreed to a roadmap to democratic reform which resulted in the countries first free presidential elections in October 2008.
Like the plot from a Alexander Dumas novel the prisoner who he had jailed so many times in the hope the people of the Maldives would forget about him eventually became his nemesis and ended his 30 years in power.