The only free and comprehensive online etymological dictionary of the Spanish language
gracias (Interjection) "thank you"
From the Latin statement gratias agere "to give thanks," but more literally "to do thanks." Gratias was the accusative plural of gratia (see gracia). For the etymology of agere, see -igar.