¡Ay, caramba! (pronounced [ˈai kaˈɾamba]) comes from the Spanish interjection ¡ay! (denoting surprise or pain) and caramba (a minced oath, a euphemism for carajo, a word with different meanings), which is an exclamation used today in surprise (usually positive) in Spanish. The term caramba is also used in Portuguese, where it used to be a minced oath for caralho, the Portuguese equivalent of the Spanish carajo, both of which descend from the Latin "caraculus"
via en.wikipedia.org