Castelmayran (; ) is a commune in the Tarn-et-Garonne department in the Occitanie region in southern France.
According to Ernest Nègre, Castelmayran comes from the Occitanàcastèlà(from the Latinàcastellum) and a Latin personal name,àMarianus.
In the 12th century, the lordship belonged to a branch of the family of Argombat which founded the Cistercian abbey of Belleperche. And by 1143 the final transfer of the abbey was discussed at a meeting held in Castelmayran.
Castelmayran had several co-seigneurs over time, among whose Nicolas de Gourgues, the last one before the French Revolution.
Before 1789, Castelmayran was a city of Gascony, in the diocese of Lectoure, and election of Lomagne.
The mayor of Castelmayran is Thierry Jamain, re-elected in 2020.