Kevin Csoboth goal 10 minutes into added time resolved the Liverpool pair’s Group A game in Stuttgart, which each captained their nation in.
Hungary closest to breaking the deadlock during a goalless first half was Szoboszlai’s disguised, dinked free-kīck, headed against the crossbar by Willi Orban.
A collision involving Hungary’s Barnabas Varga stretchered off and sent to hospital dominated the second period, which seemed to be going by without any imprint on the score sheet.
Moments before teammate Csoboth struck the post, Szoboszlai was denied a goal a minute into added time as his effort from inside the area was saved.
Grant Hanley of Scotland was stopped on the other end, but Csoboth completed a counter-action including Szoboszlai in the penultimate minute of the battle to secure it.
Hungary finishes third in the group as a result, and while Scotland is eliminated, Hungary must wait to learn whether their three points total qualifies for the last 16.
The happiness of Szoboszlai also reflects Robertson’s gloom.