The first capital of Magadha was Girivraja or Rajagriha, modern Rajgir. Later, its capital shifted to Pataliputra.