At the beginning of the nineteenth century Nuremberg was practically bankrupt. In 1806 the Holy Roman Empire was dissolved, and Nuremberg became part of the Kingdom of Bavaria, and Bavaria took over the city's debts. The first German railway, from Nuremberg to nearby Fürth, was opened in 1835.