On Feb. 22, Maldives police arrested the country’s former president, Mohamed Nasheed,and charged him with terrorism. Mr. Nasheed was refused bail, and the following day officers violently dragged him along the ground at the courthouse. The look of terror in his eyes as police officers ripped his shirt and injured his arm said it all.

A farcical trial has now begun in which Mr. Nasheed is not allowed to participate in his defense. So far judges have appeared as witnesses for the prosecution, other judges have been accused of leading the witnesses, and some witnesses have revealed they spent time with the police preparing their evidence in advance.

The arrest and prosecution of Mr. Nasheed are blatantly political. If convicted, he could face up to 15 years in prison, disqualifying him from contesting the presidency again. Police have responded brutally to peaceful protests in support of Mr. Nasheed, sending in thugs armed with iron rods and truncheons, and arresting dozens.

The country is run by the family of Maumoon Abdul Gayoom, who was Asia’s longest-ruling dictator until Mr. Nasheed won the country’s first elections in 2008. In 2012, Mr. Gayoom’s allies staged a coup d’état, forcing Mr. Nasheed from office. A year later, fresh elections were held. Mr. Nasheed won 45% of the vote in the first round, just short of an outright victory, but the regime annulled the ballot before it went to a second round. When a second election was held a few months later, Mr. Nasheed again won a plurality in the first round. But in the second round his rival, Mr. Gayoom’s brother Abdulla Yameen,played the Islamist card. He won the election by portraying Mr. Nasheed as a secularist.

The Gayoom clan, now firmly back in charge, is seeking to prevent Mr. Nasheed from challenging for power again. The charges against him relate to efforts to reform the legal system and establish judicial independence. Most of the country’s judges at the time were Gayoom appointees. Many were unqualified, with only a very basic level of education. Unsurprisingly, they resisted efforts to remove those who failed to meet the proposed standards of educational attainment and ethical conduct.

The crunch came in 2012 when Chief Judge of the Criminal Court Abdulla Mohamedfaced accusations of political bias. He had repeatedly acquitted political figures associated with the old regime despite evidence of serious crimes. Mr. Nasheed’s government tried every mechanism available to hold Judge Mohamed accountable, but all were blocked. Finally, the judge’s refusal to honor a police summons led to his arrest. This is the basis of the terrorism charge against the former president.

The prosecutor general in Mr. Nasheed’s trial is a former associate of Judge Mohamed, and the lead judge had refused to take disciplinary action against Judge Mohamed as deputy head of the Judicial Services Commission. Another judge faces allegations of bribery and the third has a criminal record.

President Yameen’s behavior is increasingly erratic and paranoid. His foreign ministry officials resort to foul-mouthed abuse of critics as well as conspiracy theories about Christian missionaries and gay-rights activists joining hands to conquer the country.

So what can be done? The glimmers of hope for a pluralist government seven years ago have been all but snuffed out. Yet Mr. Nasheed will never give up and neither will his democracy movement. They deserve international support.

Options include targeted sanctions, freezing the overseas assets of senior members of the regime and suspending the Maldives from the Commonwealth. Tourists should consider boycotting the Maldives, especially resorts owned by regime cronies.

The persecution of Mr. Nasheed is an attempt to stifle demands for democracy and create a climate of fear. The world can’t turn a blind eye to a Muslim-majority nation slipping into dictatorship justified by religious zeal, even one so small as the Maldives. The decision of India’s Prime Minister Narendra Modi not to visit as planned this week is an important precedent. The Gayoom regime’s refusal to allow an opposition party is a problem its neighbors in particular must address.

Mr. Ramos-Horta is former president of East Timor and recipient of the 1996 Nobel Peace Prize. Mr. Rogers is deputy chairman of the Conservative Party Human Rights Commission in the U.K.