EAST HARTFORD, Conn. — Connor Shellenberger sat in the stands a decade ago and watched Virginia upend Maryland to win a men’s lacrosse national championship on Memorial Day.

Ten years later, he played a big part in the Cavaliers’ latest title celebration.

Shellenberger and Matt Moore both had four goals and two assists and Alex Rode made a save with five seconds remaining to preserve fourth-seeded Virginia’s wild 17-16 defeat of third-seeded Maryland in Monday’s national title game before 14,816 at Rentschler Field to claim its second consecutive national title.

“We kind of have this stereotype as an offense that we play hero ball, but we really do whatever the defense dictates us to do,” Shellenberger said. “We took it as a challenge. We didn’t want to back down from Maryland’s defense. We wanted to go right at them.”

It was an unorthodox back-to-back for the Cavaliers (14-4), who beat Yale to claim the 2019 title. Last year’s tournament was canceled in response to the coronavirus pandemic. Virginia claimed its seventh NCAA title.

The combined 33 goals matched the title game record, first set in 1975 when Maryland defeated Navy, 20-13, and tied in 1983 when Syracuse edged Johns Hopkins, 17-16.

Logan Wisnauskas had five goals for the Terrapins (15-1), whose hopes of becoming the first undefeated champion in Division I since Virginia in 2006 came to an end. Maryland fell to 3-12 all time in title games.

Tewaaraton Award finalist Jared Bernhardt had two goals and three assists. He finished his five-year career at Maryland with a school-record 202 goals, and his 99-point season this year broke a school mark that had stood since 1963.

“We threw it all out there for them,” Maryland Coach John Tillman said. “We have nothing left in the tank, and we took this thing as long as we could take it.”

Rode made 12 saves for the Cavaliers, none bigger than stuffing Maryland faceoff man Luke Wierman in the final five seconds to preserve the victory.

Rode became the first goalie in program history to start on two different national champions.

“I had a rough day,” Rode said. “It wasn’t my best day in goal. Our defense actually played great. The [faceoff man] took a shot, and I was a little nervous. I thought I owed my team a couple, and luckily it hit me in the body.”

Virginia led 9-7 at halftime, and Maryland knotted it at 11 in the third quarter. But the Cavaliers ripped off five goals in a row, with Shellenberger scoring twice in that stretch.

The redshirt freshman had 12 goals and seven assists over Virginia’s final three games.

“He’s emerged,” Virginia Coach Lars Tiffany said. “He was a really good player down in Charlottesville, Virginia, and now the rest of the world will see here in the month of May he’s one of the best in the game — period.”

The Cavaliers maintained a 16-11 lead until Wisnauskas’s goal with 6:13 remaining. The Terps would add three more in a little more than two minutes to pull within 16-15, but Moore scored in transition off a Cade Saustad feed with 3:35 left to make it 17-15.

Virginia’s goal total was the highest allowed by Maryland this season and the highest yielded by the Terps in the postseason since an 18-9 loss to Duke in the 2005 semifinals.

“A lot of their goals came down to us not having the best fundamentals,” Maryland defenseman Brett Makar said. “We didn’t really have a clean game on our part. You really think about the one missed groundball or the bad pick play behind. Just so many plays running through my head right now, and I’m sure a lot of the guys feel that way. Defensively, it definitely wasn’t our best performance.”

Maryland narrowed the margin to 17-16 on Anthony DeMaio’s goal with 10.8 seconds left, setting up the frantic final play.

Wierman cleanly won the faceoff against Petey LaSalla and raced toward Rode, who deflected the low shot to lock up the victory.

“Luke coming down the middle, he’s shooting that shot,” Wisnauskas said. “He’s had a couple goals this season. Stuff happens. He’s in that situation, and he shoots it, and the goalie makes a good save. It’s not his fault at all. You can go back and name so many other plays. We’ve got Luke’s back. We want Luke shooting that ball.”

The celebration was the final part of Virginia’s encore, an outcome that didn’t seem particularly likely when the Cavaliers lost by 10 at Syracuse on Feb. 27. But Tiffany’s rested team — it went 22 days between its regular season finale and its NCAA tournament opener — again peaked in May, winning its sixth national title game in six appearances dating back to 1999.

There were plenty of holdovers from 2019, including Moore and Rode. Also back were midfielder Dox Aitken and long pole Jared Conners, fifth-year seniors who decided to stick around when the NCAA granted a blanket eligibility waiver for players who saw last season end so abruptly.

The payoff, it turned out, couldn’t have been much better.

“This is one of the greatest feelings ever,” Conners said. “It’s definitely the reason you come back. Talking to Dox after the game, there’s nowhere else we’d rather be. It’s been an incredible experience and an awesome ride.”

Read more from The Post: