SHOCK has turned to anger after two court rulings in the space of a few days in effect suspended, if not finished, the careers of two of Malaysia’s most prominent opposition politicians. First, on March 7th, the veteran leader, Anwar Ibrahim, of the opposition’s alliance, Pakatan Rakyat (PR), had his acquittal in 2012 on a charge of sodomy overturned by the Court of Appeal; he now faces five years in jail. And then on March 11th Mr Anwar’s lawyer, Karpal Singh, also an MP and chairman of one of the three parties that make up PR, was convicted of sedition. He escaped prison, but was fined 4,000 ringgit ($1,250). The conviction was enough to ensure that by law he has to stand down as an MP.

Both are appealing against the verdicts, which have drawn widespread condemnation, from Malaysia’s own lawyers among others. In the case of Mr Karpal, even the UN has joined criticism of the prosecution for using outdated and discredited legislation to secure the conviction. The opposition alleges that the prosecutions amount to a concerted offensive to hobble it after its best-ever result in the general election held last May. Sedition charges are hanging over several other activists and opposition politicians, including Tian Chua, vice-president of Mr Anwar’s party.

There was a strong sense of déjà vu about Mr Anwar’s conviction. His case has been rumbling on since he was accused in 2008. Known locally as Sodomy 2.0, it followed Mr Anwar’s conviction and jailing for the same offence in 1999, a verdict that was overturned in 2004. Since colonial times, sodomy has been illegal in Malaysia, which has a Muslim majority, but prosecutions are rare. Mr Anwar argues that he is a victim of politically motivated charges designed to knock him out of politics.

Certainly, the sodomy cases seem to come at the most inconvenient times. Mr Anwar’s latest sentencing came only a few days before he was due to be nominated as a candidate in a critical by-election for an assembly seat in Kajang in the state of Selangor, Malaysia’s richest. People in the court were surprised at how quickly the three judges wrapped up the trial and handed down the jail term. Had he won in Kajang, he was expected to become Selangor’s chief minister. That would have afforded him a good perch from which to assail the government. Mr Anwar is now disqualified from holding political office.

The legal basis of the conviction of Mr Karpal has, if anything, caused even more outrage. The lawyer has been found guilty of sedition for a remark he made during a press conference in 2009, when he merely expressed his legal opinion on a political dispute in the state of Perak. He said that the sultan could be legally challenged for his decision to remove the then-incumbent chief minister during a political crisis. This was deemed to be an attack on the sultan. The Sedition Act, dating from 1948, is so outmoded that the government itself promised in 2012 to remove it from the statute book. Yet not only is it still in place, but it is now being used with renewed vigour, belying government claims before the election that it had embarked on a great reform of Malaysia’s outdated and oppressive British colonial laws. The office of the UN High Commissioner for Human Rights is one of many international organisations and NGOs to have condemned the continued use of the Sedition Act in general, and its use in this case in particular.

Another group, the Asian Forum for Human Rights and Development, accused the Malaysian government of “an ongoing systematic persecution” of the opposition. The government denies any meddling in judgments reached by a judiciary it insists is independent. And the verdicts may indeed be a mixed blessing for it. PR hopes they will help an often fractious alliance to unite in adversity. Indeed, the public outrage against the convictions may give it an immediate bounce in the Kajang by-election where Mr Anwar’s wife, Wan Azizah, a political figure in her own right, will now contest the seat in his stead. This will not be the first time that she has had to take her husband’s place in an election, and may not be the last.