
IMAGE SOURCE GETTY IMAGES image caption Critics of the president have long accused him of authoritarian tendencies
The judges behind the decision were appointed in May after the National Assembly, dominated by the president’s party, sacked the previous justices.
The electoral tribunal said it would follow the Supreme Court’s order.
The ruling has been criticised by the opposition and activists, who accuse Mr Bukele of authoritarian tendencies.
The 40-year-old president was elected in February 2019 on a promise to tackle rampant gang violence and political corruption, and remains hugely popular in the impoverished Central American nation.
The ruling, handed down late on Friday, ordered the country’s electoral body to allow a president who had not been in office “in the immediately preceding period to participate in the electoral contest for a second occasion”.
“Democracy in El Salvador is on the edge of the abyss,” said Mr Vivanco, a critic of President Bukele.
The president has drawn rebukes from Washington for his constitutional changes and curbs on his critics in the media. Opponents accuse him of undermining El Salvador’s separation of power and its system of checks and balances.
His New Ideas party won a congressional majority in February and, months later, replaced five Supreme Court judges and the independent attorney general.
Last year, the president sent the military into the country’s parliament during a vote on the security budget, which opponents said was a deliberate attempt at intimidation.