The first inhabitants of this area known to history were the Pannonii (Pannonians), a group of Indo-European tribes akin to Illyrians. From the 4th century BC it was invaded by various Celtic tribes. Little is heard of Pannonia until 35 BC, when its inhabitants, allies of the Dalmatians, were attacked by Augustus, who conquered and occupied Siscia (Sisak). The country was not, however, definitely subdued by the Romans until 9 BC, when it was incorporated into Illyricum, the frontier of which was thus extended as far as the Danube.

The Roman empire in the time of Hadrian (ruled 117-138 AD), showing, on the middle Danube river, the imperial provinces of Pannonia Superior and Pannonia Inferior and the 2 legions deployed in each in 125

Map showing Constantine I's conquests of areas of present-day eastern Hungary, western Romania and northern Serbia, in the first decades of the 4th century (pink color).

In AD 6, the Pannonians, with the Dalmatians and other Illyrian tribes, engaged in the so-called Great Illyrian Revolt, and were overcome by Tiberius and Germanicus, after a hard-fought campaign which lasted for three years. After the rebellion was crushed in AD 9, the province of Illyricum was dissolved, and its lands were divided between the new provinces of Pannonia in the north and Dalmatia in the south. The date of the division is unknown, most certainly after AD 20 but before AD 50. The proximity of dangerous barbarian tribes (Quadi, Marcomanni) necessitated the presence of a large number of troops (seven legions in later times), and numerous fortresses were built on the bank of the Danube.

Pannonia Superior was under the consular legate, who had formerly administered the single province, and had three legions under his control; Pannonia Inferior at first under a praetorian legate with a single legion as garrison, after Marcus Aurelius under a consular legate, still with only one legion. The frontier on the Danube was protected by the establishment of the two colonies Aelia Mursia and Aelia Aquincum by Hadrian.

Diocletian also moved parts of today's Slovenia out of Pannonia and incorporated them in Noricum. Constantine I enlarged in 324 AD the borders of Roman Pannonia to the east, annexing the plains of what is now eastern Hungary, northern Serbia and western Romania up to the limes that he created: the Devil's Dykes.

In the 4th-5th century, one of the dioceses of the Roman Empire was known as the Diocese of Pannonia. It had its capital in Sirmium and included all four provinces that were formed from historical Pannonia, as well as the provinces of Dalmatia, Noricum Mediterraneum and Noricum Ripense.

The country was fairly productive, especially after the great forests had been cleared by Probus and Galerius. Before that time timber had been one of its most important exports. Its chief agricultural products were oats and barley, from which the inhabitants brewed a kind of beer named sabaea. Vines and olive trees were little cultivated. Pannonia was also famous for its breed of hunting dogs. Although no mention is made of its mineral wealth by the ancients, it is probable that it contained iron and silver mines. Its chief rivers were the Dravus, Savus, and Arrabo, in addition to the Danuvius (less correctly, Danubius), into which the first three rivers flow.