LYON, France — Northern Ireland secured its first victory in a major competition in 34 years on Thursday, beating Ukraine 2-0 at the European Championship.

Building on a strong finish to the first half, center back Gareth McAuley headed in a free kick from Oliver Norwood in the 49th minute. Substitute Niall McGinn added a second deep in stoppage time when Ukraine was chasing an equalizer.

The victory, Northern Ireland’s first since beating host Spain in the 1982 World Cup, means the team has a good chance of qualifying for the knockout stages of Euro 2016.

“It has been a long time,” the 36-year-old McAuley said. “We talked about leaving a legacy from this tournament. A few years down the line when I am finished and I look back on it, it will be extra special. It’s just sinking in, and now it means staying in the tournament.”

Following its opening 1-0 loss to Poland, the team now has three points. Northern Ireland’s next Group C game is against world champion Germany on Tuesday at the Parc des Princes in Paris.

advertisement | advertise on newsday

The long-awaited victory was dampened by the death of a second Northern Ireland fan at the tournament. Northern Ireland spokesman Neil Brittain said that a team supporter died in the stadium, without giving more details.

“The fan passed away as he was watching the game in the stadium,” Irish FA chief executive Patrick Nelson said. “This puts any result of a football match into perspective.”

During the match, Northern Ireland’s players wore black armbands and its fans dedicated a round of applause to pay their respects to another supporter who died following the loss to Poland on Sunday. Darren Rodgers, who was 24, died after a fall unrelated to the hooligan violence that has marred the competition at times.

Northern Ireland was a far different team against Ukraine than the one that failed to even register a shot on goal against Poland. Coach Michael O’Neill made five changes to his team in response to that lackluster start to the tournament.

His team’s first shot between the posts came as soon as the 4th minute when new addition Stuart Dallas fired into the arms of goalkeeper Andriy Pyatov.

@Newsday

Northern Ireland grew in confidence through the first half and with McAuley’s goal registered its first goal in an international competition since the 1986 World Cup.

With rain pouring down, O’Neill’s team showed the extra aggressiveness he had requested for the match at the Stade de Lyon. A short suspension in play in the 58th minute because of hail did not alter the team’s intent.

“It’s probably the proudest I have felt in a dugout as manager,” O’Neill said. “When you get a performance that is just pure commitment, pure heart, you can’t ask for anything more.”

Northern Ireland made Ukraine look downright lethargic and had little trouble in marking wingers Andriy Yarmolenko and Yevhen Konoplyanka out of the match.

For Ukraine, it was its second straight 2-0 loss and leaves the team languishing in last place in Group C with zero points. Ukraine plays Poland in its next match on Tuesday in Marseille.