It's pretty standard medical advice: a pregnant woman shouldn’t travel via airplane 36 weeks or later into her pregnancy. Despite that precaution, an occasional bundle of joy may still add an unexpected passenger to the flight manifest. As if giving birth at 40,000 feet wasn't already a stressful experience for a new mom, things can get even more hectic upon landing: Depending on the details surrounding the birth, her newborn’s citizenship could be up for debate.

There is no universal rule for how a country determines the citizenship of a newborn. Some countries just follow the jus sanguinis (right of blood) law, which means a baby’s nationality is determined by that of one or both parents. Others observe that rule and jus soli (right of the soil), where a country grants citizenship to a baby that’s simply born on its soil, regardless of the parents’ origin. These countries are mostly in the Americas and include the United States and Canada. And with the expansion of air travel, these laws had to extend to the heavens as well.

If a baby is born over United States airspace, the jus soli rule means the child would be granted U.S. citizenship, according to the Department of State Foreign Affairs Manual. Depending on the circumstances, the child may also be a candidate for dual citizenship if its parents are from a country that grants citizenship based on blood—though that would depend on the countries involved.

This same simplicity doesn’t extend to a jus sanguinis country, though. This means that an American mother can’t attain French citizenship for her baby just because she gave birth over French airspace. The baby would simply revert to the parent's U.S. citizenship, since the United States also generally follows jus sanguinis when a baby is born to U.S. citizens in a foreign country. Since jus sanguinis is the far more common rule around the globe, most babies born on a flight over international waters or foreign airspace will likely wind up taking the citizenship of its parents.

If there’s a case where the child could potentially be stateless—such as when a mother herself has no official citizenship and the baby is born in international airspace—the baby would likely take the citizenship of whatever country the plane itself is registered in, according to the United Nations’s Convention on the Reduction of Statelessness agreement.

Despite all these complex laws, mid-flight births are exceedingly rare—so rare, in fact, that most airlines don’t even keep track of the number of babies born in the air. An expecting mother likely wouldn't even be able to get onto a flight in the first place, since many airlines have rules that prohibit women from flying after they've reached a certain point in their pregnancy.

Have you got a Big Question you'd like us to answer? If so, let us know by emailing us at bigquestions@mentalfloss.com.