Yoweri Museveni, President of Uganda
Ugandan President Yoweri Museveni promising not to stay in power too long during his first inaugural address in 1986 Reuters

Uganda has undoubtedly attracted lots of international attention lately all thanks to President Yoweri Museveni's crackdown on homosexuals.

In fact Nigeria, Cameroon and Arizona have all distinguished themselves with overtly homophobic legislation.

Behind the signing of Uganda's controversial anti-gay bill lurks political subterfuge and vanity.

Museveni originally rejected the controversial bill, which sees life imprisonment for homosexual offences, saying that there were other ways to "cure" homosexuals, and life imprisonment was not the right one.

But about a month later Museveni had consulted a team of "experts" who declared homosexuality "not genetic" but a "social behaviour". Satisfied with proof that sexual orientation was dependent on moral choices made by individuals, Museveni signed the bill amid local applause and international outrage.

Museveni's rapid change of heart might have something to do with plans to start oil production in Uganda in 2016/2017. This will have raised political stakes in the country enormously, while also granting Uganda a degree of impunity on the global stage.

After 28 years of uninterrupted power, Museveni knows he is ripe for replacement by another political leader at the next election.

It seems likely Museveni has come under pressure from a range of political imperatives, and has buckled in order to preserve his power. Definitely among them would be influential parliamentary speaker Rebecca Kadaga, a staunch supporter of the country's anti-gay bill. In return for signing the bill Kadaga could well have pledged her support to the president in the run-up to the next elections.

Kadaga has often expressed her will to turn the controversial bill into law, leading human rights activists to protest.

According to independent journalist and reporter Fulvio Beltrami, who writes for Italian newspapers Indro and Reteluna.it, important oil reserves were found in the northern area of Uganda in 2004.

The drilling operations are assigned to three companies: British Tullow, French Total and Chinese Cnooc.

Once extracted, the oil will be refined in Uganda and then sold in local and regional markets, with a small percentage destined to the European and Chinese markets, Beltrami said.

US president Barack Obama said that if Uganda passed its homophobic bill this would complicate relations with the US.

Museveni, probably allured by the opportunity to hold on to power at whatever cost, has ignored the US. But he can afford to these days thanks to Africa's newest and biggest investor: China.