The President of Uganda, Yoweri Museveni, has taken an HIV test in public, saying he wants all Ugandans to know their HIV status if the country is to reduce new infections.

President Museveni conducted the test at the Kiswa Health Centre in Kampala, in front of government officials and reporters on Friday.

Politicians in Uganda rarely test for HIV in public, despite recommendations from health experts that it would set a good example in a country that has seen HIV infection rates increase.

Uganda remains notorious for its violent record towards the LGBT community. President Museveni has so far resisted passing the country’s Anti-Homosexuality Bill.

First introduced in 2009 by MP David Bahati, it specifies long jail sentences for those convicted of same-sex sexual acts and in certain cases has suggested the death penalty.

In March, President Museveni accused European countries of trying to promote homosexuality and sexual liberalisation. He described gay people as “deviants” and claimed “there is no discrimination, no killings, no marginalisation” of gay Ugandans.

In December 2012, President Museveni said gay people should not be killed or persecuted, but added: “We cannot accept promotion of homosexuality as if it is a good thing.”

Although welcoming President Museveni’s decision to publicly test for HIV, the United Nations’ HIV/AIDS agency, UNAIDS, has previously warned Uganda that its aggressive stance towards same-sex sexual relationships risks undermining efforts to reduce the spread of HIV.

Men who have sex with men (MSM) are often prevented from accessing HIV testing and medication in countries such as Uganda where same-sex sexual relationships are illegal.

The general HIV rate in Uganda stands at 7.3%, up from 6.4% in 2005, according to a 2011 survey by Uganda’s Ministry of Health.

Officials want to test 15 million people by the end of 2014 – but they acknowledge it will be hard to reach the target.

The Ugandan Government has now added male circumcision to the plan to fight HIV, in response to studies showing the procedure reduces the risk among African heterosexual men of getting HIV by up to 60% .