Syphilis is primarily transmitted through sexual contact, including vaginal, anal, and oral sex. It can also be transmitted from mother to baby during pregnancy, a condition known as congenital syphilis. The infection is highly contagious during its primary and secondary stages.