The lifetime ban on blood donations by homosexual and bisexual men will be lifted in England, Scotland and Wales.
Ministers have agreed to let men who have not had sex with another man in the past 12 months to donate from November.
The restrictions were put in place in the 1980s to prevent the risk of HIV contamination.
However, the latest medical evidence presented to a government panel argued the ban could no longer be justified.
Ministers in the three countries accepted the argument and said they would be relaxing the rules. Northern Ireland is expected to make a decision soon.
The National Blood Service screens all donations for HIV and other infections. However, there is a "window period" after infection during which it is impossible to detect the virus.
In the UK, a lifetime ban was introduced in the early 1980s as a response to the Aids epidemic and the lack of adequate HIV tests.
The ban had been questioned both on equality and medical grounds.
The government's Advisory Committee on the Safety of Blood, Tissues and Organs has been reviewing the policy.
Committee member Prof Deirdre Kelly said the safety of the blood supply is "absolutely essential" and that any restrictions "must be based on the latest scientific evidence".
She said there had been advances in the testing of donated blood which had significantly reduced the chance of errors and had reduced the size of the "window period".
She said the data showed that "the risk from a 12-month deferral was equivalent to permanent deferral" so "the evidence does not support the maintenance of a permanent ban".
Other at-risk groups, such as people who have been sexually active in high-risk countries, are already banned from donating for a year.
The findings were accepted by health ministers and a one-year ban will come into force in England, Scotland and Wales on 7 November.
Several other countries have already come to similar verdicts.
South Africa has introduced a six-month gap between sex and donation. It is a year in Australia, Sweden and Japan.
Research published at the end of last year suggested there was no significant increase in the risk of HIV infection after the change in the rules in Australia.
Dr Lorna Williamson, medical and research director of NHS Blood and Transplant, said: "The change does not alter the estimated risk, therefore patients needing a transfusion can be sure blood is safe."
She said enforcing the one-year rule would be "based on trust" when men register to donate blood.
Gabriel Theophanous has needed a blood transfusion every month for 30 years because he has the condition thalassaemia. He said: "I just want to know the blood is safe - this issue doesn't cause me any concern."
The gay rights group Stonewall said the move was a "step in the right direction".
However, its chief executive Ben Summerskill said there would still be tighter controls on low-risk gay men than on high-risk heterosexuals.
"A gay man in a monogamous relationship who has only had oral sex will still automatically be unable to give blood but a heterosexual man who has had multiple partners and not worn a condom will not be questioned about his behaviour, or even then, excluded."
Sir Nick Partridge, chief executive of the Terence Higgins Trust, a sexual health charity, said the new rules were "necessary, fair and reasonable".
However, he said it was impossible to say how many men would actually be able to start donating blood as "the vast majority of gay men are still [sexually] active".