Yes, you can have sex while pregnant as long as your obstetrician has not contraindicated it. In some situations, such as placenta previa or a history of preterm labor, sex may increase the risk of complications.
In most cases, sex is considered safe during a healthy, low-risk pregnancy because the amniotic sac and the uterine muscles help protect the baby.
It is important to consult your obstetrician to know if there are any contraindications and what is considered safe. A medical consultation is also recommended if you experience persistent contractions or vaginal bleeding after sex.