In 1918, after World War I, the ceasefire line placed the city under administration of the newly formed Kingdom of Yugoslavia. By the Treaty of Trianon from 1920, the city was assigned to Hungary, and became the capital of the reduced county of Bács-Bodrog.