The Maldives' Parliament has passed a law that strips people serving prison sentences of their political party memberships, a rule critics say is designed to oust jailed former President Mohamed Nasheed from politics.

The law was passed Monday by a 42-to-2 vote in the 85-member Parliament. Other lawmakers abstained.

President Yameen Abdul Gayoom's party holds an overwhelming majority in Parliament and critics say he uses it against his opponents.

Nasheed was sentenced to 13 years in prison earlier this month for arresting a senior judge when he was in office three years ago. His party has retained him as its leader. Nasheed's supporters say the charge was aimed at preventing him from contesting the 2018 presidential election.