The only free and comprehensive online etymological dictionary of the Spanish language
genio (2) m. (Noun) "Genius;" "angel," "divine figure"
From Latin genius "guardian spirit." The modern sense of genio as a divine figure is taken from artistic representations of the Roman genius in art. Earlier meaning a source of strength, before that the spirit of a people - which begat a second meaning in Latin of a guardian spirit (see quote below). From gens "clan," "household" (see gente).

"The worship of the Genius [the guardian spirit] was a remarkable part of the religion of the Romans; they having derived it from the Tuscans, in whose system it formed a prominent feature. The word Genius is evidently a translation of a Tuscan term, signifying Generator, and the Genius was therefore viewed as a deity who had the power of producing...

When a local genius made himself visible, he appeared in the form of a serpent, that is, the symbol of renovation, or of new life. In works of art, the genii are usually represented as winged beings; an on Roman monuments, a genius usually appears as a youth dressed in toga, with a patera or cornucopia in his hand, and having his head covered. The genius of a place is represented in the form of a serpent eating fruit placed before him." M. A. Dwight, Grecian and Roman Mythology (1849)