Footage of fetuses at different gestational stages was used by researchers to show that healthy babies yawned less as they approached their birth dates.
Scientists at the universities of Durham and Lancaster said while it remains unclear why unborn babies yawn, the movement may be related to the maturation of their central nervous systems.
'It may be that, in order to get part of the brain to mature in the correct way, you need a certain stimulus, and yawning might be that stimulus,' said Nadja Reissland, a psychologist who specialises in fetal development at the University of Durham.
The researchers used 4D ultrasound scans to capture a rapid sequence of images for eight female and seven male fetuses at 24, 28, 32 and 36 weeks of gestation.
All the unborn babies were healthy and were scanned for 20 minutes.
The team went through the images frame by frame and counted the yawns and other movements made by the babies. Over 58 scans, they recorded 56 yawns and 27 other mouth movements.
Yawns are said to be distinguishable from other movements because a yawning mouth opens more slowly than it closes.
The findings, which appear in Plos One, show similar yawning rates in boys and girls. However, yawning decreased steadily from nearly twice every 10 minutes in fetuses at 24 weeks' gestation, to none at 36 weeks.
'Unlike us, foetuses do not yawn contagiously, nor do they yawn because they are sleepy, said Ms Reissland. 'Instead, the frequency of yawning in the womb may be linked to the maturing of the brain early in gestation.
'Given that the frequency of yawning in our sample of healthy foetuses declined from 28 weeks to 36 weeks gestation, it seems to suggest that yawning and simple mouth opening have this maturational function early in gestation.'
Previous work has found evidence to suggest that some medical conditions might affect the yawning patterns of growing fetuses.
The scientists now hope to scan more unborn babies to confirm the downward trend in yawning with gestational age, and to move on to studies of other fetuses, such as those exposed to drugs, or diagnosed with specific medical conditions.
To view a video showing the 4D ultrasound scan of a fetus yawning, please click here.