Viareggio remained under the control of the Austrians until 1817 when, as part of the agreements from Congress of Vienna, Maria Luisa di Borbone was assigned the new Duchy of Lucca. In 1820 Viareggio was officially proclaimed city.Carlo Ludovico di Borbone helped the city, building a new church, a royal casino and two beach resorts, the first ones to be built in Viareggio.