If further work confirms the link, there could be a major advance in the fight against MS, the scientists wrote in the Journal of Neurology, Neurosurgery and Psychiatry.
MS is a progressive disease of the brain and central nervous system in which the immune system goes haywire, attacking a fatty insulative sheath around nerve fibres.
The symptoms range from numbness and tingling to muscle weakness and spasms, cramps, nausea, depression and memory loss.
In 2011, doctors reported on the case of a 26-year-old Australian man who was diagnosed with MS several months after being confirmed as having HIV.
The sclerosis symptoms disappeared completely after the patient started taking anti-HIV drugs and remained that way throughout the following 12 years in which his health was monitored.
This was followed by a Danish study, which tried to see whether antiretroviral drugs may treat or slow progression of MS, but its sample size was too small to throw up a solid conclusion.
In the latest study, a team led by Julian Gold, a professor at the Prince of Wales Hospital in Sydney, Australia, looked at a British databank describing details of hospital treatment in England between 1999 and 2011.
During this time, more than 21,000 people who were treated in hospital had HIV.
These were compared against a group of almost 5.3 million people who did not have HIV and who were treated for minor conditions and injuries.
In the HIV group, only seven people developed MS over the ensuing years, far fewer than the 18 that would have otherwise been expected -- a risk reduction of nearly two-thirds.
The authors acknowledged weaknesses in their study -- they had no idea, for instance, whether patients with HIV took antiretroviral drugs to suppress the virus.
They speculated that MS may be dampened because the immune system is brought back under control, although further work is needed to show whether the unexpected benefit comes from the virus or the drugs used to combat it.
"Further investigation of our finding has the potential, after more than 170 years since MS was first described... to reveal the (causes) of MS," they said.
Gold, who is also honorary professor at Queen Mary University in London, is a leader of a pilot study in which 25 MS patients in Britain are being given an antiretroviral called raltegravir (brand name Isentress) to see if the drug affects brain lesions.