Rajgir (Girivrajapur) was the earliest capital of the Magadha kingdom. It served as the capital during the reign of Bimbisara and Ajatashatru. Later, the capital was shifted to Pataliputra (modern-day Patna) by Udayin. Vaishali was a republican confederacy, not the Magadhan capital.