Bledi Bardic scored his first goal of the season in added time. (Photo courtesy of the Cosmos)

By Michael Lewis Editor

NEW YORK — For the first time since 2016, the Cosmos will live to play another day in the Lamar Hunt U.S. Open Cup.

They have Bledi Bardic to thank for that.

The striker headed home an Ansi Agolli corner kick six minutes into second-half stoppage time to lift the Cosmos to a 2-1 first-rond victory over a plucky Black Rock FC side at Rocco B. Commisso Soccer Stadium Wednesday night.

The Cosmos advanced to the second round as they will meet Hartford Athletic (USL Championship) at Al-Marzook Field at the University of Hartford in Hartford, Conn. next Tuesday at 7:30 p.m.

New York had been eliminated in the opening round in 2017 and in a play-in match last year.

Immediately after scoring, Bardic ripped off his white shirt and ran to the stands to celebrate in front of the Cosmos supporters. He was given a yellow card for the infraction.

About a minute later, after Black Rock FC kicked off, the game was whistled over.

The hosts botched a golden opportunity to take the lead in the 12th minute after a Black Rock FC player was called for a hand ball in the penalty area.

Captain Danny Szetela took the ensuing penalty kick and sent a shot to the lower right corner that goalkeeper Leland Gazo dove to his left to knock away.

The Cosmos took the lead in the 28th minute as forward Aaron Dennis slotted home a left-wing cross from Giuseppe Barone from the goal mouth past Gazo for a 1-0 lead and his third goal in as many matches. The Elmont, N.Y. native scored in both of the Cosmos’ 2-0 victories in the National Premier Soccer League.

Despite giving up a goal, Black Rock FC, an amateur team composed of prep school and college players, refused to wilt and limited the Cosmos’ scoring opportunities in the second half, allowing them to stay within striking range.

The visitors equalized on Komar Martinez-Paiz’s goal in the 87th minute. It appeared the game was heading to extratime, but Bardic made sure of that.

Black Rock FC brought only 14 players to the game, limiting head coach Jon Moodey to a maximum of three substitutions.

The Cosmos return to league play as they host Boston City FC at Mitchel Athletic Complex in Uniondale, N.Y. on Saturday at 7 p.m.