British parents should not be allowed to choose the sex of their babies, regulators have ruled.
The public believes babies need unconditional love, the HFEA says
The Human Fertilisation & Embryology Authority said the status quo, which only allows sex selection for strictly medical reasons, should remain.
The decision follows a year-long public consultation, which suggested 80% of people were against selection.
The ruling, made after some couples went abroad to chose their child's sex, has been widely welcomed by doctors.
HFEA chairman Suzi Leather said there was a "huge public consensus" against allowing parents to select a child's sex, unless it was to protect against disease.
"The public view was really that great value should be put on the unconditional nature of parental love," she told the BBC.
Ms Leather said the decision to keep the gender selection ban had been difficult and both public opinion and expert advice was considered.
The rules will mean that only those people with a serious sex-linked disorder in the family, such as Duchenne's Muscular Dystrophy - which only affects boys, will be able to select a baby's sex in the UK.
It would not be possible to stop people going abroad for the treatment, Ms Leather said.
The HFEA also called for a loophole in the law, which allows unlicensed clinics to carry out sperm sorting using fresh sperm, to be closed.
Health Secretary John Reid backed the decision.
"I fully support the view that people should not be allowed to select the sex of their children on social grounds.
"I can confirm that as long as I am secretary of state for health, sex selection will only be permitted on compelling medical grounds.
"We will consider carefully whether the law needs to be changed to ensure this ban can be maintained effectively."
Professor Alison Murdoch, chairwoman of the British Fertility Society, was among those who welcomed the ruling.
"Like the general public, the majority of our members want sex selection only where there are sound medical reasons," she said.
It was a view shared by the ethics committee of the British Medical Association. Dr Michael Wilks, its chairman, said: "Sex selection purely for social reasons is unacceptable."
But Dr Simon Fishel, managing director of the Centre for Assisted Reproduction in Nottingham said: "Those families that wanted to use sex selection for choosing the gender of their child will be disappointed and will now be forced to go abroad to seek treatment."
Nicola Chenery, who gave birth to twin girls earlier this month after going to Spain to use sex selection technology, argued that it was "only IVF and uses the same procedures".
Alan Masterton, from Dundee, who with his wife has had three failed attempts at selecting a girl, agreed.
He said: "This does not stop people from having this procedure done. Make no mistake, all it does is make it more expensive."
Julia Millington of the ProLife Party said the HFEA should have gone further, because selection to prevent disease was "equally as objectionable and discriminatory as sex selection for social reasons".
Liberal Democrat health spokesman Paul Burstow urged the government to introduce a law to ensure parents are not able to choose the sex of their baby.
"This recommendation from the HFEA needs more than just government agreement, it needs government action to take it forward."
Doctors can determine a baby's gender in two ways - through genetic testing or sperm sorting.
Genetic testing enables female embryos to be identified before being placed in the womb, so-called preimplantation genetic diagnosis (PGD).
Sperm sorting involves separating "male" and "female" sperm, depending on whether they carry male or female chromosomes, then choosing which to use to inseminate a woman or create embryos in the laboratory.
Last year, a US clinic revealed it had helped six British couples to choose their baby's gender.
All had done so for "family balancing" reasons.