In the 2001 census, the population was 5,003, with 64.3% declaring themselves Croats, 13.77% as Bosniaks, and 6.05% as Serbs. It is a small village directly across the river from the city of Brčko in Bosnia and Herzegovina. During the war in Bosnia, many Muslim and Croat citizens of Brčko lived as refugees in Gunja. The village has a mosque, one of few in Croatia. The settlement was founded in the 18th century by settlers from Bosnia.