 Through the Croatian–Hungarian Settlement of 1868 a corpus separatum was formed containing the city of Rijeka, as a territory directly controlled by Hungary.In 1881, the military frontier, containing the Senj and Velebit foothills, was absorbed by the Kingdom of Croatia-Slavonia.Following World War I, the dissolution of Austria-Hungary, and the Treaty of Trianon, Hungary lost its possessions in the region.