“Unsafe sexual behaviour” and a lack of testing is being blamed for a failure to cut the number of cases of HIV among gay and bisexual men in the last decade.

Huge improvements in treating and testing for HIV have failed to curb infections, scientists, writing in the Lancet Infectious Diseases, have suggested, with a return of risky sexual practices.

New infections were static at about 2,300 a year between 2001 and 2010, despite rises in early diagnosis and far more people taking medication.

One in 20 gay and bisexual men in the UK now has HIV, rising to one in 12 in London, according to the Medical Research Council (MRC) and Health Protection Agency (HPA), which carried out the research.

Undiagnosed HIV infections in gay and bisexual men increased from 7,370 in 2001 to 7,690 in 2010.

Over the same time period HIV testing of gay men and bisexual men increased by 370% to 59,300 per year and the number receiving HIV care rose from 69% to 80%.

Despite a 20% reduction in the average time between infection and diagnosis, from four years to 3.2 years, 38% of infections in 2010 were still diagnosed after the time patients should have started antiretroviral (ARV) treatment.

Dr Valerie Delpech, the HPA’s head of HIV surveillance, said: “We are seriously concerned about the level of ongoing HIV transmission and the significant impact this is having within the MSM [men who have sex with men] community.

“The most plausible explanation for these results is continuing unsafe sexual behaviour coupled with insufficient HIV testing, showing us just how vital safe sex programmes engaging MSM remain.”

Sir Nick Partridge, the chief executive at Terrence Higgins Trust, the UK’s largest HIV and sexual health charity, said: “These findings highlight the real challenges faced by HIV prevention work, which need much greater attention. Spending on safer sex campaigns for gay men has fallen dramatically over the past ten years. Much greater priority needs to be given to HIV prevention by the NHS, local government and the gay community.”

Yusef Azad, the director of policy at the National AIDS Trust, said: “The Medical Research Council and the Health  Protection Agency research which shows a failure to reduce HIV transmission amongst men who have sex with men despite a decade of prevention work makes for depressing reading.”