Boston Bruins goaltender Jeremy Swayman looks for the puck during the third period of an NHL hockey game against the Philadelphia Flyers, Tuesday, April 6, 2021, in Philadelphia. The Bruins won 4-2. Credit: Derik Hamilton / AP

Jeremy Swayman had a memorable National Hockey League debut for the Boston Bruins on Tuesday night at the Wells Fargo Center in Philadelphia.

The former University of Maine All-American goalie and Hobey Baker Hat Trick finalist made 40 saves in an important 4-2 victory, including 23 in a second-period barrage that saw the Flyers outshoot Boston 25-7.

Swayman’s effort was just two shy of NHL Hall of Famer Bernie Parent’s franchise record of 42 stops in a debut performance.

“It was one of the best experiences of my life,” the 22-year-old Swayman said in a postgame interview with NBCSN’s Keith Jones.

The 6-foot-2 native of Anchorage, Alaska, a fourth-round draft pick of the Bruins (111th overall) in 2017, made a left pad save on Scott Laughton’s short-handed breakaway back-hander in the first period. Boston captain Patrice Bergeron scored the second of his three goals on the ensuing rush to give Boston a 2-0 lead.

Philadelphia scored two early second-period goals to tie it, but Swayman closed the door the rest of the way. Brad Marchand’s short-handed goal in the third period decided it.

“My mentality throughout the game was just don’t get high or too low,” Swayman told the New England Sports Network. “I learned that from [UMaine assistant/goalies coach] Alfie Michaud back at Maine. That’s going to stick with me for a long time.”

Swayman said he focused on one shot at a time.

“My job is to stop pucks and that’s what I wanted to do for this team in order to give them a chance to win,” he said. “I know if I do my job, they’re going to do theirs and that’s exactly what happened. It’s a great team win. I’m super happy,” he said.

NESN-TV reporter Sophia Jurksztowicz mentioned to Swayman that he seemed to always have a big smile on his face during stoppages in play.

“That explains it all. It’s a game that I love. I enjoyed every second of it,” he said. “That’s what a lot of vets told me about how to go into it, especially [No. 1 goalie Tuukka Rask]. He said, ‘enjoy it, it’s once in a lifetime’ and that’s exactly what I did.

“You’re on the biggest stage with the best players in the world. How can you not have fun doing that?” he added. “It was fun.”

Bruins coach Bruce Cassidy said Swayman was great, mentioning that Bergeron cited his outstanding play after the lackluster second period.

“He was battling all night. He gave us a true chance to win especially in that second period,” Cassidy said. “From the get-go, the way he prepared in the locker room, he looked ready, he looked calm. He looked the same way on the ice. Good for him, hopefully many more [wins] to come.”

UMaine head coach Red Gendron said Swayman played like he did with the Black Bears.

“Nobody here is surprised by how he played. He was good,” Gendron said.

“It’s a tribute to his character. He prepares relentlessly. He works on his game all the time. He is always looking for an edge.”

Gendron said Swayman’s performance will earn the trust of the Bruins’ coaches and players.

“You don’t get a second chance to make a first impression,” he said.

Michaud said he’s proud of the way Swayman maintained the proper mindset in such a high-intensity situation.

“That’s a big stage to be put on but he looked relaxed and confident and he was having fun out there, which is a good sign,” Michaud said.

Swayman told Michaud he was looking forward to watching the game video with Bruins goalies coach Bob Essensa to break down his performance and see where he can improve.

“He’s driven,” said Michaud, who believes Swayman is in great hands with Essensa and former UMaine goalie Mike Dunham, the Bruins’ goaltender development director.

“They are laid back but they expect a lot and they pay attention to detail,” Michaud said. “They don’t put pressure on the young goalies.”

Swayman received the start because Rask is injured, No. 2 goalie Jaroslav Halak tested positive for COVID-19 and Dan Vladar played in Monday’s 3-2 overtime loss to the Flyers.

Swayman has compiled a 8-1 record, a 1.89 goals-against average and a .933 save percentage this season for the American Hockey League’s Providence Bruins.

Last season, he won the Mike Richter Award given to college hockey’s best goalie. He was 18-11-5 with a 2.07 GAA and a .939 save percentage and three shutouts. The Hockey East Player of the Year posted a 48-save gem in a 1-0 win over Providence in the “Seniors Night” game that proved to be the last of his three-year career when the postseason was canceled because of the COVID-19 pandemic.