The Lipizzans endured several wartime relocations throughout their history, each of which saved the breed from extinction. The first was in March 1797 during the War of the First Coalition, when the horses were evacuated from Lipica. During the journey, 16 mares gave birth to foals. In November 1797, the horses returned to Lipica, but the stables were in ruins. They were rebuilt, but in 1805, the horses were evacuated again when Napoleon invaded Austria. They were being taken care of in Đakovo Stud. They remained away from the stud for two years, returning April 1, 1807, but then, following the Treaty of Schönbrunn in 1809, the horses were evacuated three more times during the unsettled period that followed, resulting in the loss of many horses and the destruction of the written studbooks that documented bloodlines of horses prior to 1700. The horses finally returned to Lipica for good in 1815, where they remained for the rest of the 19th century.