Vatsaraja was succeeded by Nagabhata II (805–833). Nagabhata II was initially defeated by the Rashtrakuta ruler Govinda III (793–814). But later recovered Malwa from the Rashtrakutas. He conquered Kannauj and the Indo-Gangetic Plain as far as Bihar from the Palas. He rebuilt the great Shiva temple at Somnath in Gujarat. Kannauj became the center of the Gurjara-Pratihara state. At this time, the Gurjara-Pratihara dynasty covered much of northern India.