On 29 October 1918, the Croatian Sabor declared independence and decided to join the newly formed State of Slovenes, Croats and Serbs, which in turn entered into union with the Kingdom of Serbia on 4 December 1918 to form the Kingdom of Serbs, Croats, and Slovenes. The Treaty of Trianon was signed in 1920, at the end of World War I, between the Allies of World War I and Hungary as one of the successor states to Austria-Hungary. The treaty established the southern border of Hungary along the Drava and Mura rivers, except in Baranya, where only the northern part of the county was kept by Hungary. The territorial acquisition in Baranya was not made a part of Slavonia, even though adjacent to Osijek, because pre-1918 administrative divisions were disestablished by the new kingdom. The political situation in the new kingdom deteriorated, leading to the dictatorship of King Alexander in January 1929. The dictatorship formally ended in 1931 when the king imposed a more unitarian constitution transferring executive power to the king, and changed the name of the country to Yugoslavia. The Cvetković–Maček Agreement of August 1939 created the autonomous Banovina of Croatia incorporating Slavonia. Pursuant to the agreement, the Yugoslav government retained control of defence, internal security, foreign affairs, trade, and transport while other matters were left to the Croatian Sabor and a crown-appointed 'Ban'.