Alex Ovechkin was back in his red Washington Capitals sweater and on the ice Tuesday night at Capital One Arena, in action for the first time since a one-shift appearance eight days earlier against the New York Rangers.

The captain’s presence — after he had missed seven of the past eight games because of a lower-body injury, skating only 39 seconds in the game he did play — was one of the only significant aspects of the Capitals’ 2-1 win over the Boston Bruins, but it was an uplifting one for Washington.

“Right now, I’m 100 percent,” Ovechkin said afterward. “I didn’t feel any soreness. I feel comfortable. That’s the most important thing. This time of year, you have to be smart and you have to think about the future — not only regular season.”

With the first-round matchup already set — the Capitals will host the Bruins to open the Stanley Cup playoffs at 7:15 p.m. Saturday — there was nothing for either team to play for in the season finale, other than a slight mood booster ahead of the postseason.

Washington’s Michael Raffl scored the game-winner with 1.8 seconds left on a nifty wrist shot from the goal line. He had nearly no angle but still beat Bruins goaltender Jeremy Swayman for his first goal with the Capitals and his fourth of the season.

“It is always good to get a win,” Coach Peter Laviolette said. “. . . I think everybody is excited that the season is over and we are putting it off to the side and we are getting ready for the playoffs. That is what we will build on.”

The score was tied at 1 entering the third period. The Bruins’ Curtis Lazar had a tap-in goal with 9:49 left in the second before the Capitals’ Carl Hagelin tied it by jamming in a rebound of Zdeno Chara’s point shot with 3:45 to go. It was Hagelin’s sixth goal of the season.

Ovechkin skated 19:00 and put four shots on goal. He finished with 24 goals in 45 games, making this the first season he did not score at least 30 goals in his 16-year NHL career. He remains one goal away from tying Marcel Dionne (731) for fifth on the NHL’s all-time list.

Ovechkin described his return from the injury as a “battle.”

“I tried to play in New York but I didn’t feel comfortable, and, obviously, we don’t want to make a risk, and that was a smart move,” he said.

The Capitals finished with a 36-15-5 record and 77 points, tied with the Pittsburgh Penguins for the most in the East Division, despite a rash of injuries, coronavirus issues and a tight salary cap. Washington locked up second place in the East with its 2-1 overtime win against Philadelphia on Saturday. The Bruins clinched third in the East with a 3-2 overtime win Monday night against the New York Islanders. The fourth-seeded Islanders will face Pittsburgh, the East champion, in the first round.

With nothing at stake, the Bruins sat most of their top players Tuesday, but the Capitals dressed all of their regulars who were healthy enough to play. Washington was still missing forward T.J. Oshie and defenseman John Carlson because of lower-body injuries. Oshie was injured in the second period Saturday and is day-to-day. Carlson was out for the fourth time in seven games.

The Capitals again had a few players skate slowly to the bench Tuesday: defensemen Chara, Nick Jensen and Justin Schultz and center Lars Eller. All finished the game.

“We will do our best to keep the injuries in the maintenance area and get them taken care of and hopefully get more guys back on the ice,” Laviolette said. “Close it out tonight, but when we wake up [Wednesday], it is playoff time.”

Center Evgeny Kuznetsov and goaltender Ilya Samsonov remained unavailable while on the NHL’s coronavirus protocols list. Both missed the regular season’s last five games, including a game against the Rangers because of disciplinary reasons.

Capitals rookie Vitek Vanecek was in net Tuesday and made 24 saves. Vanecek was thrust into the spotlight in January when Samsonov landed on the covid-19 list and tested positive. With Samsonov sidelined for six weeks, Vanecek made the crease his own and stole more than one game for an inconsistent Capitals group.

Vanecek finished the regular season 20-10-4, but Tuesday’s game — against a Bruins team featuring mostly prospects and minor leaguers — was the first time Vanecek had allowed fewer than two goals since an April 27 shutout of the Islanders.

The game provided few fireworks, but it did give a couple of glimpses of what the Capitals’ lineup could look like in Game 1 on Saturday night.

If Kuznetsov and Oshie remain out, Washington will have to choose a player from its taxi squad to fill its 12th forward spot. That role was filled by Philippe Maillet on Tuesday, by Garrett Pilon on Saturday and by Daniel Carr on Friday in a loss to the Flyers.

When the postseason begins, there is no salary cap, meaning the Capitals can bring up whomever they want from their American Hockey League affiliate in Hershey, Pa.

On the blue line, the return of a healthy Carlson would mean Trevor van Riemsdyk could slot out of the lineup. He played the last 11 games for the Capitals.

More from The Post: