Police in the Maldives have arrested 30 people as thousands of opposition supporters rallied in the capital calling on President Yameen Abdul Gayoom to resign and demanding the release of a former president in police detention.

Protesters gathered in capital island Male from many outer atolls of this Indian Ocean archipelago nation on Friday.

Police say those arrested include both opposition protesters and an unknown pro-government group that attempted to disrupt a sit-in at the end of the rally.

Former president Mohamed Nasheed was arrested this week for his alleged role in the arrest of a senior judge three years ago. He has been charged under the country's terrorism law, but his supporters say the allegations are politically motivated.

Nasheed was the country's first democratically elected president.