Badami, ancient Vatapi, was the capital of the Chalukyas of Badami from the 6th to the 8th century. The dynasty's founder Pulakeshin I fortified the town around 543 CE, and his successors carved the famous cave temples into the red sandstone cliffs. The greatest king, Pulakeshin II, stopped the northern emperor Harsha at the Narmada and fought long wars with the Pallavas of Kanchipuram, who captured Vatapi in 642.
Under the Chalukyas, the nearby towns of Aihole and Pattadakal became workshops of temple building, where architects tried out both the northern (nagara) and southern (dravida) styles of tower side by side. Aihole's Meguti inscription of 634 CE, composed by the poet Ravikirti, records Pulakeshin II's victories. At Pattadakal, the coronation town, Queen Lokamahadevi built the Virupaksha temple around 745 to celebrate her husband Vikramaditya II's victory over the Pallavas.
The Chalukyas were overthrown by the Rashtrakutas in the mid-8th century. Badami later passed through many hands, from the Vijayanagara kings to Tipu Sultan and the British. The Group of Monuments at Pattadakal was declared a UNESCO World Heritage Site in 1987.