In the 19th century Baja became a minor railway hub, but its importance declined as the railway to Fiume (Rijeka) was built in order to get Hungarian grain seaborne. The city was still a commercial and service center for the region.