Rising numbers of gay and bisexual men are having unprotected sex, leading to an increase in HIV rates over the past 20 years.

The number of gay and bisexual men infected with HIV has almost doubled in 20 years following a recent sharp rise in the number having unprotected sex.

Cases of HIV among gay and bisexual men rose by 76 percent between 1990 and 2010, while the number having sex without a condom rose by 26 percent, according to a study by the Health Protection Agency and University College London.

One in 20 gay or bisexual men in the UK today have HIV, with the figure rising to nearly one in 12 in London, the research showed. New diagnoses among gay men reached a record in 2011, with 3,010 men diagnosed.

Valerie Delpech, head of HIV surveillance at the HPA, said: "Everyone should use a condom when having sex with new or casual partners, until all partners have had a sexual health screen.

"We also encourage men who have sex with men to get an HIV and STI screen at least annually, and every three months if having condomless sex with new or casual partners - and clinicians to take every opportunity to recommend HIV testing to this group.

"Through combining earlier and more frequent HIV testing, programmes that reduce unsafe sexual behaviour and higher levels of antiretroviral coverage for those requiring it, we could substantially reduce HIV transmission in this group."

Last November, the HPA said the number of people living with HIV had reached a record 96,000, while a quarter of those who have the virus remain unaware they have been infected.

The findings, published in the journal Plos One, suggest the increase in infections would have been 68 per cent greater without the introduction of anti-retroviral drugs in the same period, and 400 per cent more if gay and bisexual men had ceased to use condoms entirely from the year 2000 onwards.

Professor Andrew Phillips, the lead investigator at UCL who conducted the research, created a model reconstructing the HIV epidemic among gay and bisexual men in the UK.

"We were able to explore the interplay between HIV testing rates, antiretroviral treatment and sexual behaviour on HIV transmission and incidence," said Prof Phillips.

"By better understanding the driving forces behind the trends we've seen in the past, it will allow us to make informed choices to reduce new HIV infections in the future."

The research follows a study that warned "unsafe sexual behaviour" and a lack of testing was behind a failure to cut the number of cases of HIV among gay and bisexual men in England and Wales in the last decade.