During the Portugal game, images of a banner among the home supporters in the stands reading "ANTI LMBTQ" – referring to the Hungarian language abbreviation for lesbian, gay, bisexual, transgender and queer – circulated on social media. The matter was reported to UEFA by anti-discrimination group Fare.
Before the clash with France, some Hungary fans took part in a pre-match march in Budapest and unveiled a banner opposing the act of kneeling before matches, a peaceful anti-racism protest in which several teams participated.
Given the latter incident took place outside the stadium, it did not fall under UEFA's jurisdiction, but European football's governing body said it was investigating possible acts of discrimination inside the Puskas Arena from both matches.
And UEFA confirmed sanctions against the Hungarian Football Federation (MLSZ) on Friday in response to discriminatory acts at those contests and Hungary's 2-2 draw with Germany in Munich.
UEFA's Control Ethics and Disciplinary Body ruled that Hungary should play their next three UEFA competition matches behind closed doors, with the third suspended for a probationary period of two years.
The MLSZ has also been ordered to pay a €100,000 fine and to implement a directive to display UEFA's '#EqualGame' banner at UEFA competition matches where it serves as the host association.
Hungary do not play another UEFA competition fixture until the 2022-23 Nations League, which starts in June next year.
They are back in action in World Cup qualifying when they host England on September 2. The order to play behind closed doors does not apply to World Cup qualifiers, which fall under FIFA's jurisdiction.
Hungary are second in World Cup qualifying Group I with seven points from three games.