Historians can trace it from the settlement of the Moravian Duke called Wratislaw as far back as 907. In 1217 Bratislava had the freedom of the city (and remained for 200 years under Hungarian rule). In 1405 it became the Hungarian Imperial City and from 1526 to 1784 it was the main city and Crown seat of the Habsburgs in Hungary and was called Pozsony. The Pressburg Austro-French peace treaty ended the Third Coalition War in 1805. From 1825 to 1848 Bratislava was the seat of the Hungarian State Parliament and in 1919 it became Czechoslovakian.