BUFFALO, N.Y. — Thunder rumbled over the stadium, lightning flickered across the night sky, and for nearly three hours, the field sat empty as rain hammered the turf. When the clouds finally parted and the game began, the crowd at UB Stadium witnessed a back-and-forth battle that came down to a single snap inside the 1-yard line.

Buffalo quarterback Elijah Holmes turned again and again to his favorite target, Chance Morrow, delivering three touchdown passes — the final one a 5-yard strike with 4:23 left — to lift the Bulls to a 21-17 victory over Albany early Friday.

Holmes finished 26-of-47 passing for 189 yards, with Morrow hauling in seven receptions for 48 yards. The touchdowns came from 9, 4, and 5 yards out, each showing a different dimension of their chemistry. The 9-yarder in the second quarter tied the game at 7-7 after a 15-play, 75-yard drive that consumed more than six and a half minutes. Then, with 2:46 remaining in the first half, Morrow leaped over his defender along the sideline, snatched the ball, and dragged both feet in bounds for a 4-yard score that put Buffalo ahead 14-7.

Albany, an FCS program now under first-year head coach Tom Perkovich, refused to fold. The Great Danes struck first when Kai Colón found Tavahri Groves for a 14-yard touchdown with 3:02 left in the opening quarter. Buffalo’s early offensive struggles kept the game tight, but the defense kept them in it.

Just before halftime, RJ Kocan drilled a 46-yard field goal to cut the deficit to 14-10. The kick followed a dramatic sequence: Dana Johnson Jr. strip-sacked Holmes, and Dorian Royal recovered the fumble at the Buffalo 27-yard line. Albany appeared ready to settle for a 44-yard field goal, but a roughing-the-kicker penalty on Buffalo gave Perkovich a choice. He took the penalty, accepted a fresh set of downs, and erased the points from the board. Two plays later, Justus Murray Jr. caught a 14-yard touchdown pass from Colón, putting Albany ahead 17-14 with 3:23 left in the third quarter.

Buffalo’s offense sputtered until the fourth quarter, when Holmes engineered the game-winning drive. He methodically moved the chains, mixing short passes with scrambles, and capped it with a 5-yard touchdown to Morrow.

Albany had one last chance. Rahshan La Mons ran for a 4-yard gain, setting up second-and-goal from inside the 1-yard line with 1:26 on the clock. But a false start penalty pushed the Great Danes back to the 5. On fourth-and-goal, Buffalo linebacker Stevie Bracey met Luke McAuliffe at the 3-yard line, wrapping him up and driving him to the turf. The Bulls sideline erupted.

“We knew we had to make a stop,” Bracey said after the game. “We practiced that situation all week. It was just about execution.”

Buffalo (1-0) will travel to FIU on Sept. 12. Albany (1-1) visits LIU on the same day. The weather delay pushed the start past 11 p.m., but the Bulls’ late-night resilience gave them a season-opening win they won’t soon forget.