swear (v.) Look up swear at Dictionary.com
Old English swerian "take an oath" (class VI strong verb; past tense swor, past participle sworen), from Proto-Germanic *swarjan-, (cognates: Old Saxon swerian, Old Frisian swera, Old Norse sverja, Danish sverge, Middle Dutch swaren, Old High German swerien, German schwören, Gothic swaren "to swear"), from PIE root *swer- (1) "to speak, talk, say" (cognates: Old Church Slavonic svara "quarrel," Oscan sverrunei "to the speaker").

Also related to the second element in answer. The secondary sense of "use bad language" (early 15c.) developed from the notion of "invoke sacred names." Swear off "desist as with a vow" is from 1898. Swear in "install in office by administration of an oath" is from 1700 in modern use, echoing Old English.