Judges in Malawi have annulled last year’s elections and called for a new ballot within 150 days.

In a landmark judgment that experts hailed as a step forward for democracy, the country’s constitutional court found that evidence of fraud and malpractice meant the results of the poll could not be allowed to stand.

The judges had taken more than 10 hours to read their 500-page decision, amid heavy security and calls for calm from diplomats. Their judgment described “widespread, systematic and grave” irregularities including significant use of correction fluid to alter the outcome.

A new vote would be held within 150 days, the court said, saying it hoped the ruling would not “destroy the nation”.

Last year’s presidential election plunged the long-peaceful southern African nation into deadly confrontations and widespread unrest.

The incumbent president, Peter Mutharika, was declared the narrow winner of the May election with 38% of the vote, followed by Lazarus Chakwera with 35% and Saulos Chilima in third with 20%. The four other candidates collectively got nearly 6% of the vote.

Chakwera and Chilima claimed that irregularities affected more than 1.4m of the 5.1m votes cast. The five-judge panel heard that the vote was rigged by the president, who was standing for a second term, and the electoral commission. Both have denied the charges.

Hundreds of opposition supporters took to the streets to celebrate the judgement.

“We are happy with the outcome of the case. We went to court alleging that the polls were rigged. What we have seen today is that our argument had merit,” said Eisenhower Mkaka, secretary general for the opposition Malawi Congress Party. “Democracy in Malawi that has won.”

Timothy Mtambo, the chair of the Human Rights Defenders Coalition said: “I would like to say congratulations to all Malawians who believe in justice. What this means is that our struggle has started bearing fruits,” he said.

Mark Bottomani, the minister of information and a government spokesperson, said he needed to consult on what the decision meant for the government.

Nic Cheeseman, an expert in African politics at the University of Birmingham, said the decision was exciting because it reinforced a precedent set by judges who annulled elections in Kenya in 2017 on similar grounds, forcing a controversial rerun. President Uhuru Kenyatta won the fresh election as the leading opposition candidate boycotted the vote.

“This draws a line in the sand. It says that elections have to be better. The first few cases that followed Kenya suggested that it would be a one-off but now we have a trend. The next court can cite Malawi and Kenya,” Cheeseman said.

Analysts have frequently spoken of democracy being under pressure across Africa, with a series of recent setbacks for reformers and a longer-term trend of growing authoritarianism. However, judges in many African countries have repeatedly stood up to autocratic rulers or highlighted official wrongdoing.

“We are still seeing progress, but in fits and starts. But we shouldn’t expect it to be linear. These are struggles, people are fighting for democracy … and those victories that have to be struggled for are often fragile,” said Cheeseman, speaking from Lilongwe, the Malawian capital.

The judges also ordered the electoral commission to pay the legal expenses of the two opposition candidates who challenged the result, but said Mutharika must cover his own costs. The ruling can be appealed to the supreme court.

People across the country followed the day-long court session, read out live on radio in English and Chichewa.

Malawian journalists covering the deliverance of the judgment on Monday. Photograph: Amos Gumulira/AFP via Getty Images

Many listened closely as the court listed multiple irregularities, from the liberal use of correction fluid to the lack of signatures on some results forms. The judges challenged the electoral system, saying the results suggested that no one was elected by a majority in accord with the constitution, citing dictionary definitions of majority and plurality. They suggested that Malawi’s Elections Act be amended.

The months-long court case was accompanied by sometimes violent street protests demanding the resignation of the electoral commission chairwoman, Jane Ansah. Demonstrators set up roadblocks in the capital last October, leading to the deployment of police. One officer was killed and police stormed the area, spraying teargas and attacking the public.

The Malawi human rights commission released a report late last year accusing the police of serious human rights abuses, including rape and assault, in one confrontation.

The two opposition candidates who challenged the election result had in recent days called for calm. On Thursday, Chilima urged Malawians to remain peaceful and challenged Mutharika to show the qualities of a statesman. He also asked the Malawi police service, which was supported by the military as unrest grew, to stop thugs who might want to take advantage of any public outcry after the ruling.

“There is more that binds us than that which separates us,” he said. “Violence and civil strife are alien to this land. We must not lose this gem. It is what defines us as a people.”

The international community, including the UN and African Union, issued several statements before the judgment urging people across Malawi to uphold the rule of law and remain calm.

A joint statement by diplomats from the US, Britain, the EU, Japan and others acknowledged the tensions around the ruling.

“Malawi can draw on an impressive history of institutions and leaders stepping forward to safeguard your democracy and ensure peaceful resolution for internal tensions,” the statement said, urging all parties to respect the court’s decision, as well as the right to appeal.