The temple was built by king Rajaraja Chola II. He ruled the Chola Empire between 1146 and 1172 CE. The established capital for his predecessors was Gangapuri, also referred in some inscriptions as Gangaikonda Cholapuram, named after the holy north Indian Ganges River and goddess. Rajaraja II, however, spent most of his time in the secondary capital city of Ayirattali, also called Pazhaiyarai and Rajarajapuri. This urban complex included Darasuram, the site of Airavatesvara Temple. He was a patron of Tamil literature and sponsored new Hindu temples in the empire, instead of enhancements and expansions supported by his father and grandfather. The temple at Ayirattali, which came to be known as Airavatesvarar temple in inscriptions is one of his legacy.