It took just five days for Brazil’s supreme court to spring into action when the Jair Bolsonaro administration last month cancelled the census, citing the Covid-19 pandemic and budgetary constraints.

Justice Marco Aurélio ordered the government to reverse course and conduct the constitutionally mandated decennial survey, which had already been postponed once last year. “It is up to the supreme court to impose the adoption of measures to make the demographic research feasible,” he said.

For many, the ruling — like scores of others taken by the top court during the coronavirus pandemic — was a welcome one in favour of scientific and evidence-based decision-making. But it was also a reminder of how active the top judicial body had become in Brazilian politics.

Since Bolsonaro — a far-right former army captain — came to power more than two years ago, the court better known as the STF has emerged as a bulwark against what some claim are the excesses of the populist leader.

For the justices and those close to the court, this activist stance is permitted by Brazil’s far-reaching constitution and warranted by the president’s autocratic tendencies and denialist attitude towards the pandemic. For critics, the justices are engaged in “judicial activism” that delegitimises the decisions of the court.

Those in between see a vicious cycle, with each side feeding off each other and gradually weakening Brazil’s already fragile institutions.

“It is quite obvious that the STF has been activist for some time [and] has become more and more so. The fundamental problem right now is we have an executive that is just below any standard, that is totally dysfunctional,” said Filipe Campante, a professor at Johns Hopkins University.

“When you have the executive completely unable to perform basic functions, then the other powers are forced to step in. But that feeds back into the dysfunction because they’re not supposed to do it. It feeds the antagonism that Bolsonaro lives off.”

Campante says an example of this is the census, which is an “extremely basic function of the state [that] the executive has proven unable and unwilling to do”.

But the tension between the 11-member supreme court and the executive branch has been laid bare in even starker terms by the Covid-19 pandemic, which has already claimed the lives of 430,000 Brazilians.

In the past year, the STF has made 9,000 decisions related to the pandemic, according to a tally by the court. Most of these rulings backed mainstream scientific approaches to tackling the virus, including the use of lockdowns and social distancing and the importation of vaccines.

They have, however, irked Bolsonaro, who has consistently played down the severity of the disease and attempted to reopen local economies shuttered by state governors. Tensions reached a peak last year when the populist leader joined rallies calling for the closure of the court. He has since pushed congressional allies to try to impeach STF justices.

“In Brazil, we are living in a very unique moment with a lot of conflict and this has been greatly enhanced by the pandemic. There is a clear divide between people who tried to minimise the disease, including those close to the government, and those who recommend caution,” Justice Gilmar Mendes told the Financial Times.

“The court has been the target of much criticism from people who support these denialist measures. They say that we usurp competencies that should be of the executive power, but we are sure that we have fulfilled our role within the framework of the constitution,” said Mendes, who is himself accused by critics of politicising the job.

Brazilian supreme court judges are nominated by the president and serve until retirement at the age of 75. Of the 11-member bench, seven were appointed by former leftwing Workers’ party administrations. One was appointed last year by Bolsonaro.

Much of the court’s power stems from the size and scope of Brazil’s constitution, which at more than 70,000 words is one of the world’s longest and most detailed. The breadth of the charter allows the STF to judge the legality of a vast array of issues.

“This puts the STF at the centre of the Brazilian political debate. If a president — who can even count on the support of the legislature — attacks the constitution, it is the role of the court to impose limits,” said Eloísa Machado, a constitutional law professor at the Getúlio Vargas Foundation.

Opponents say, however, that the court’s interpretation of the constitution increasingly amounts to “judicial activism,” which delegitimises its authority.

Uziel Santana, the president of Anajure, an evangelical lawyers association, said that a decision by the STF last month allowing state and municipal authorities to prohibit in-person religious services during the pandemic was “flawed from a technical and legal point of view”.

“It is not for the supreme court to act as a legislator, [but] increasingly in recent years it has been legislating. This activism ends up interfering too much in the sphere of another power, and this is not a good thing in a democratic state of law,” he said.

For Santana, one specific problem was the frequency of so-called monocratic decisions, where a single justice can rule on issues with wide-ranging ramifications for society. Between 1988 and 2018, more than 72 per cent of cases ended with a monocratic decision, according to data from the Getúlio Vargas Foundation.

Most recently, justice Edson Fachin single-handedly annulled the graft convictions of former president Luiz Inácio Lula da Silva, restoring the leftwing leader’s political rights ahead of elections next year. The decision was then upheld by a full plenary vote following an appeal by state prosecutors.

“The supreme court in the US has become deeply politicised at some level, but Brazil is even worse because you don’t have parties, you have interests. The justices have political interests and make decisions according to political interests,” said Campante.

“You reach a situation where anything they decide loses legitimacy. You think: ‘what are the political interests behind this’?”

Additional reporting by Carolina Pulice