According to Columbia University Medical Center, the diaphragm develops in the fetus between the seventh and 10th week of pregnancy. This is also around the same time the esophagus, stomach and intestines develop.
BabyCenter says that the fetus may hiccup as soon as the 11th week of pregnancy. The movements are too small for the mother to feel because the baby is about the size of a fig at that point.
The contraction of the diaphragm sucking amniotic fluid into the fetal lungs causes hiccups. However, there is no risk or discomfort to the fetus at this time, according to Med-Health, since the lungs are not yet used to process oxygen.