TO THE casual observer, all seems well in Senegal. Visitors to Dakar, the capital, fly into a new world-class airport. The economy grew by 6.8% last year and the discovery of natural gas heralds an even brighter economic future. To boot, the national team has performed well at the football World Cup.

But the political graffiti scrawled across Dakar’s walls tell a different story. The messages demand freedom for the political opponents of President Macky Sall, several of whom have been imprisoned. With a presidential election just eight months away, fears are growing that democracy in Senegal, long an example for west Africa, is being subverted.

The political system has been tested before. Unlike most west African countries, Senegal has never had a military coup, but in 2012 the previous president, Abdoulaye Wade, did run for a third term, which the constitution proscribes. Mr Sall, riding a wave of popular anger, defeated him.

Now Mr Sall’s government stands accused of selectively enforcing corruption laws to sideline his opponents. In March Khalifa Sall (no relation), the mayor of Dakar, was sentenced to five years in prison for embezzling $3.4m. Another opposition leader, Barthélémy Dias, was found guilty of contempt of court when he protested against the verdict. He will spend six months in prison.

Another potential challenger, Karim Wade, the former president’s son, was arrested in 2013 and found guilty of corruption two years later. After Mr Sall pardoned him in 2016, Mr Wade immediately flew to Qatar. Some observers think his exile was part of a deal with the government. But he is now considering coming back to stand in the election.

Potential candidates face other obstacles. A law introduced in April requires them to obtain signatures from 1% of the registered voters in each of Senegal’s 14 districts. Hundreds of people protested against the measure, saying it was unfair to poorer candidates. But the government says it is needed to ensure that only serious contenders appear on the ballot. Parliamentary elections held last year were chaotic, in part because they featured 47 electoral lists.

The protests over the election law and more recent demonstrations by students, angry about unpaid grants, have been met with violence by the government. In May a student was shot dead in the northern city of Saint-Louis, leading to yet more unrest. Images of police brutality have been widely shared on social media. One disturbing video shows a police van crashing through protesters outside Dakar’s main university.

Many Senegalese are also unhappy that little of the country’s new wealth is trickling down to them. GDP per person was just $2,566 (measured at purchasing-power parity) in 2016, according to the World Bank. The unemployment rate is over 15%. That makes the government nervous—and may increase its propensity to silence critics.