Király made his debut for the Hungarian national team against Austria in 1998. After only four minutes, he saved a penalty from Austria’s all-time top scorer Toni Polster, and Hungary won 3–2. During the 2006 FIFA World Cup qualifying, Király was the only player in the Hungarian squad to appear in all of their ten qualifying matches. He had not played for the national team since the embarrassing 2–1 defeat by Malta on 11 October 2006, but was called up to the squad for the World Cup Qualifiers against Sweden and Portugal in September 2009 and has remained in the squad despite being second choice behind Gábor Babos. On 12 November 2015, he earned his 100th cap for Hungary in a 1–0 win away to Norway in the first leg of their UEFA Euro 2016 qualifying play-off in Oslo. He was the second Hungarian to reach the milestone, after József Bozsik of the Golden Team. Király was eventually called up in Hungary’s UEFA Euro 2016 squad. Aged 40 years, 2 months and 2 weeks, Király set a new record as being the oldest player to feature in a European Championship, in Hungary’s 2–0 group win over Austria, breaking Lothar Matthäus’ record. On 14 June 2016, Király played in the first group match in a 2–0 victory over Austria at the UEFA Euro 2016 Group F match at Nouveau Stade de Bordeaux, Bordeaux, France. Three days later on 18 June 2016 he played in a 1–1 draw against Iceland at the Stade Vélodrome, Marseille. He also played in the last group match in a 3–3 draw against Portugal at the Parc Olympique Lyonnais, Lyon on 22 June 2016. He announced his retirement from international football on 2 August 2016. However, on 15 November 2016, he played his testimonial match against Sweden. He played first 30 minutes in 2-0 loss.