Putting on extra pounds between pregnancies significantly increases the risk of stillbirth or infant death, a major study has found.
The discovery is said to have "profound" implications for women expecting a second child, according to the Swedish authors.
Researchers also found that slimming down after a first pregnancy reduces the chances of an overweight mother losing her baby.
The study is based on data from more than 450,000 women whose details were recorded on the Swedish Medical Birth Register. Scientists assessed the risk of stillbirth and infant death - death within the first year of life - experienced by women whose weight changed between their first and second pregnancies.
Overall, babies of mothers whose Body Mass Index (BMI) increased by at least four units were 55% more likely to be stillborn and 29% more likely to die within a year than those of women of stable weight.
For those women who started off at a healthy weight and whose BMI rose by two to less than four units between pregnancies, the risk of infant death increased by 27%. Among this group, the risk of infant death was 60% higher for mothers whose BMI went up by four or more units.
BMI is a widely used measurement that relates height and weight. For Swedish women of average height, a 2-4 unit rise in BMI would mean they had gained an extra 13-24 pounds.
Lead researcher Professor Sven Cnattingius, from the Karolinska Institute in Stockholm, said: "The public health implications are profound.
"Around a fifth of women in our study gained enough weight between pregnancies to increase their risk of stillbirth by 30-50%, and their likelihood of giving birth to babies who die in infancy increased by 27-60%, if they had a healthy weight during their first pregnancy."
The study, reported in The Lancet medical journal, also showed that overweight women who managed to slim lessened their chances of tragedy.
Those who shed at least six kilograms (13 pounds) before their second pregnancy reduced the risk of losing a baby within the first 28 days of life by 50%.
Co-author Professor Eduardo Villamor, from the University of Michigan School of Public Health in the US, said: "The prevalence of overweight and obesity in pregnant women has reached epidemic levels. More than half of women in the USA and one in three women in Sweden are either overweight or obese at the start of their pregnancy.
"Our findings highlight the importance of educating women about maintaining a healthy weight during pregnancy and reducing excess weight before becoming pregnant as a way to improve infant survival."
The clinical definition of "overweight" is a BMI of 25 to 29.9 and of "obese" one of 30 or more.
Dr Daghni Rajasingam, from the Royal College of Obstetricians and Gynaecologists, said: " Women who are overweight or obese, whether planning a first pregnancy or are between pregnancies, should try to lose weight on a structured weight loss programme recommended by a healthcare professional - aiming to lose around one kilogram or one to two pounds a week. Even a small weight loss can give you and your baby significant benefits.
"Maintaining a healthy lifestyle through regular moderate physical activity and eating well is important throughout a woman's life.
"The RCOG believes that healthy living must be embedded into all aspects of our lives and we support the development of policies to restrict the use of industrially-produced trans-fatty acids in food and stronger regulation in the promotion and sale of foods high in salt, sugar and fat."
Neonatal medicine expert Professor Andrew Whitelaw, from the University of Bristol, said: "Excessive fat tissue increases the risk of critical oxygen deprivation during labour and also increases inflammation and that could trigger pre-term birth which certainly increases mortality.
"Treatment programmes to reduce weight gain between pregnancies have proved difficult in the past but are clearly needed. It would help if we knew about causes of death. To investigate that would require an even larger study.
"The British NHS would be ideal as we have a universal health system and a population about seven times greater than Sweden."
Another British expert, Professor Basky Thilaganathan, director of foetal medicine at St George's University Hospital, stressed that even a 55% increased risk of stillbirth would mean only one in 200 women in the UK losing their babies.
"Although the relative risk appears substantial - 55% increase - the absolute risk remains low for stillbirth," he said.
"The distinction between these two sorts of risks should be made to prevent unnecessary alarm."