SOME voters sketched, scratched and scribbled on their ballots. The cleverest crossed out letters from the voting instructions to form dirty words. Photos of their handiwork appeared on Twitter on March 4th as Salvadoreans voted in municipal and legislative elections. One in ten voters defaced their ballots or left them blank. In a country where voting is obligatory, a record 58% stayed at home.

The right-wing opposition party, the Nationalist Republican Alliance (Arena), had a clear lead in valid votes. It won nine out of 14 major mayorships, including San Salvador, the national capital, and 37 of 84 seats in the national assembly. Arena’s chairman said its success was a prelude to victory in next year’s presidential election.

In fact, the election was a repudiation of the main parties, both of which are tainted by corruption. The real winner was a politician who was not running, belongs to no party and encouraged voters to spoil their ballots: Nayib Bukele, the outgoing mayor of San Salvador. He is now the front-runner for the presidency.

The Farabundo Martí National Liberation Front (FMLN) of President Salvador Sánchez Cerén saw its worst defeat since it ceased being a guerrilla army a quarter-century ago. It won just two mayorships of big cities and 23 seats in congress, eight fewer than before. On election night a drum kit sat unused on a stage outside FMLN headquarters while speakers blared lyrics made ironic by the day’s events: “I know it’s too late to beg forgiveness.”

The FMLN first won power in 2009, promising economic reform, social change and less violence. It has failed to deliver. Under Mauricio Funes and then Mr Sánchez Cerén, GDP growth has averaged less than 2% a year, poverty has risen and El Salvador became the most murderous country in the world. Mr Funes has been in Nicaragua since 2016, when prosecutors started investigating him on suspicion of illegally enriching himself while he was president. Mr Sánchez Cerén barely appears in public. There are rumours he is ill.

Arena has its own corrupt politicians. Mr Funes’s predecessor, Tony Saca, is awaiting trial for funnelling hundreds of millions of government dollars into his bank accounts. Most of the 13 legislators being investigated for corruption are or were from Arena. Eleven ran for re-election; all of them won.

So did Arena’s candidate to be mayor of San Salvador, Ernesto Muyshondt. A member of the MS-13 street gang has testified that he paid $69,000 to the outfit in exchange for votes in the presidential election in 2014, when he was Arena’s vice-chairman. The gang has family and other ties to about a tenth of the population.

Mr Muyshondt’s victory was no triumph for Arena. He won with fewer votes than the party’s losing mayoral candidate got in 2015. The party lost votes in the legislative election, too. It won only because voters were even more disgusted with the left than with the right. None of the smaller parties, which are also plagued by scandals, won more votes than the number of blank and spoiled ballots.

The only politician who had cause to cheer the high rate of abstention was Mr Bukele. Some voters spoilt their ballots by scrawling on them, “Nayib 2019”. A slick 36-year-old businessman, Mr Bukele has enthralled the capital’s voters with projects to revitalise poor neighbourhoods, progressive stances on social issues such as gay marriage and shrewd use of social media. The FMLN kicked him out in October (supposedly for “verbal aggression” against a city employee, but probably because rivals wanted him out of the way). He formed the New Ideas Movement. Since it was not yet a party, the group put forward no candidates in the elections.

Mr Bukele aims to become the first president in three decades who belongs to neither of the main parties. On the day after the elections he posted a video on Facebook in which he criticised pundits who declared Arena the winner. “They’re analysing the scoreboard of a game that the population is no longer playing,” he said. Three days later, the video had 1.5m views. If the presidential election were held tomorrow, polls suggest, Mr Bukele would win easily.