The only free and comprehensive online etymological dictionary of the Spanish language
maestro m. (Noun) "teacher"

10th cent. From Latin magistrum, accusative of magister 'id.,' from magis "great" and *-tero- (see más and -tr- respectively).

Unusual variants maestre, maese derive from the nominative and vocative cases of magister respectively. Rare examples of native reflexes from declension cases other than the accusative. These examples form the origins of the surnames Maestro, Maestra, Maeso, Maese, Maesso, Maes, Maestud, and Mastro.

Romance: Western Vulgar Latin: Asturian maestru, Portuguese maestro, Galician mestre, Catalan mestre, French maestro, Italian maestro; Eastern Vulgar Latin: Romanian maestru; Sardinian: maistru