The Liber Pontificalis indicates that the basilica was built between 468 and 483 at the will of Pope Simplicius, who dedicated it to St Stephen and had it constructed over an ancient barracks. This was demolished and flattened to make way for the basilica, probably in the fifth century.
Only in the twelfth century did the church take on its present form.
In addition, between 642 and 649 Pope Theodore I had the relics of St Primus and St Felician transferred from the catacombs on the Via Nomentana and placed in the north-eastern transept of the basilica, within a chapel dedicated to the saints.
Under Pope Nicholas V (1447-1455), the care of the church, which was by then in ruins, was entrusted to the Hungarian Pauline order, thanks to the procurator of the Pauline order, Kapus Bálint, who enjoyed good relations with the pope himself. This is how the main altar came to be dedicated to the Hungarian saints - among others - of the Árpád royal family, such as St Stephen, the first king of Hungary, his son St Emeric, and King Ladislaus.
Finally, in 1580, with the support of Pope Gregory XIII, the Collegium Hungaricum was founded. Having merged for financial reasons with the Germanicum College, its purpose was to train good priests who would contribute to the Catholic Counter-Reformation.