Following the Peruvian War of Independence , it became the capital of the Republic of Peru .
And after the Peruvian War of Independence , it became the capital of the Republic of Peru .