It's unlikely that one dose will harm your baby, but taking ibuprofen (Advil and Motrin) is generally not recommended when you're pregnant, especially during the third trimester.
Several studies have been done on the effects of ibuprofen and other nonsteroidal anti-inflammatory drugs (NSAIDs), such as aspirin and naproxen, during pregnancy. The U.S. Food and Drug Administration found significant evidence that taking ibuprofen during the third trimester can be harmful to babies. For example, research shows that ibuprofen can cause a passage in the baby's heart to close prematurely, possibly leading to heart or lung damage, or even death.
Taking ibuprofen or other NSAIDs in the last few weeks of pregnancy has also been linked to a low level of amniotic fluid and high blood pressure in a newborn's lungs. There's also some concern that these medications may delay or prolong labor and, if used within a week of delivery, increase your risk of bleeding.
Some evidence suggests that taking ibuprofen in the first month of pregnancy could raise the risk of miscarriage.
If you need pain relief while you're pregnant, stick with acetaminophen (Tylenol) which has a long history of being safe to use during pregnancy.
If you can't take acetaminophen while you're pregnant, talk with your healthcare provider about whether the benefits of ibuprofen outweigh potential risks.