The Chola dynasty was one of the longest-ruling dynasties in the history of southern India. In Bangalore the Cholas ruled nearly a century. The heartland of the Cholas was the fertile valley of the Kaveri River, but they ruled a significantly larger area at the height of their power, including the present-day Bangalore. During the reign of Rajaraja Chola I—around 1004 AD—the cholas captured Bangalore after defeating the Gangas. During their rule, they built many temples in and around Bangalore with the Chokkanathaswamy temple, Mukthi Natheshwara Temple, Choleswara temple and the Someshwara Temple being prominent ones. The Chokkanathaswamy temple at Domlur, whose earliest inscriptions date back to the 10th century AD, is the oldest temple in the city. Originally built by Raja Raja Chola I, the temple was later renovated by the Hoysalas and Vijayanagara rulers. The temple's deity was Lord Shiva, but later a Vishnu temple was built for the local residents who were mainly Vaishnavas.