Ouro Prêto was the capital of the state of General Mines before the planned city of Belo Horizonte was built in 1898.