Ugandans go to the polls after one of the most keenly-watched and violent election campaigns in a generation, as the pop star politician Bobi Wine tries to unseat Yoweri Museveni from his 34-year rule.

Wine is one of nine opposition challengers and has won the support of many young people in Uganda – where the median age is 15.7 – with his charismatic, anti-corruption message.

Many observers see the challenge to Museveni, who at 76 is twice as old as his challenger, as emblematic of a continent-wide generational struggle between aging leaders who refuse to relinquish power and younger voters mobilising against them.

Violent suppression of Wine’s supporters by security forces points to Museveni’s concern over the threat Wine poses to a sixth term in power, which was only made possible when MPs changed the constitution to remove age limits. He has repeatedly accused Wine of being a “traitor” planning a foreign-backed insurrection.

Helicopters and military tanks have patrolled the skies and empty streets of the capital, Kampala, and other cities in recent days, in the latest display of the state’s force.

More than 55 people died in November after Wine was officially confirmed as a candidate, and he has been detained and prevented from campaigning on multiple occasions. Members of his opposition National Unity Platform party and other opposition figures have been attacked and repeatedly arrested, purportedly because Wine’s rallies are held in breach of Covid-19 restrictions.

On Wednesday, Wine, whose real name is Robert Kyagulanyi, said members of his security detail around his home were ordered to leave. In recent weeks, security forces have aggressively shut down his campaign activities, including dragging him from his car during a press conference last week. In December Wine said his bodyguard had been killed by soldiers. In an interview with the Guardian at the turn of the year, he described the campaign as “a war and a battlefield”.

Violence against opposition figures and their supporters is not new, but the extent of the crackdown has been shocking. “The brazenness of the violence is new,” said Lydia Namubiru, a journalist and the Africa editor at Open Democracy. “It’s both because he [Wine] is seen as a threat in the election but also because of what he symbolises.”

On Tuesday, Uganda’s communications regulator ordered internet providers to block all social media platforms and messaging applications until further notice, heightening fears of state-backed moves to compromise the election’s integrity. Facebook and Twitter were among apps that became inaccessible on several network providers in the country.

Facebook announced on Monday it had taken down a network of fake and duplicate accounts linked to the country’s information ministry.

On Wednesday, the US and EU said they would not observe the elections after several officials were denied accreditation.

Museveni, who took power in 1986, enjoys widespread support, particularly among more conservative, rural, and older voters who credit him with economic and healthcare gains and rural development.

“I expect my candidate to win massively,” said Prima Mbazi, wearing the yellow cap of the ruling National Resistance Movement party in Kampala, on the eve of the vote. “Our future is secure in his hands.”

“He has offered free primary and secondary education for all children from families to study; we access health services in hospitals and at least every village has access to electricity. He needs to continue to secure our future,” she said.

On the campaign trail, the memory of mass suffering under the Idi Amin regime in the 1970s underscores Museveni’s campaign message of stability and continuity.

“When Museveni speaks, it’s all about how he rescued the country when basic services were non-existent,” said Namubiru. “But people under the age of 35 have only a vague recollection of how things were then and don’t feel they were liberated. They are growing to become a significant percentage of voters.”

Moreover, Museveni’s message of economic progress jars with a harsh reality, particularly for younger people, more than 80% of whom work in the informal labour market.

Criticisms of political patronage under Museveni’s government have likewise grown in recent years. Elective positions have more than doubled since 2006 to almost 3 million officials – one for every 16 people, according to civil society groups.

In Wakiso in central Kampala earlier this week, 21-year-old Aggrey Mark Tabuswa and a group of Wine supporters rallied passersby on megaphones. “Bobi Wine knows our suffering,” Tabuswa said. “He has passed through difficulties and seen it all in life. He grew up in a slum. He will give us jobs.”

The difficulty of unseating powerful long-term rulers was on sharp display in Uganda’s 2016 election, and expectations of a fair and transparent vote this time around are low.

Gerald Walulya, a lecturer at Makerere University, in Kampala, said the election had already been significantly compromised. “The candidates have lacked the freedom they require to freely canvas for votes and this has undermined the entire exercise,” he said. “The events, which have included blocking opposition candidates, harassing them, arresting them and killing their supporters, are likely to discourage some citizens from voting.”