Defenseman Matt Niskanen, left, signed a seven-year deal worth $40.25 million with the Capitals. (Duane Burleson/Associated Press)

In his first free agency period as the Washington Capitals general manager, Brian MacLellan wasted little time stamping his vision onto the roster. In a matter of hours Tuesday, the Capitals inked two former Pittsburgh Penguins defensemen to lucrative long-term deals that addressed an area of need and generated buzz around the NHL.

The loudest splash came last, when Matt Niskanen signed a seven-year deal worth $40.25 million, one of the richest contracts handed out on the first official day of free agency. Niskanen will be reunited with both fellow Penguins blue-liner Brooks Orpik, who signed a five-year, $27.5 million deal earlier in the day, and former Pittsburgh assistant Todd Reirden, who recently joined the Capitals to coach the defensemen.

“We had some needs and we addressed them,” MacLellan said from the team’s practice facility. “We had cap room. Ownership gave the green light to get to the cap, and we spent the money where we felt we needed to spend it the most.”

A puck-moving, right-handed defenseman, Niskanen was rewarded handsomely for a banner year in Pittsburgh, where he set career-highs with 46 points (10 goals, 36 assists) and 81 games. MacLellan said the Capitals had been balancing negotiations with another defenseman late in the day, but “it ended up going Niskanen’s way.”

Fifteen months ago, when Niskanen got engaged, he scheduled his wedding date for Saturday, not anticipating the weekend would ultimately prove so important — or lucrative. So when Orpik interviewed in Washington on Sunday, it doubled as a scouting mission for Niskanen. The rave review Orpik gave helped sway one of the market’s most sought-after targets.

“He just got a really good feel for what they’re trying to do, the direction they’re headed, the people they’re around,” said Niskanen, 27, adding that he left other “slightly higher” offers on the table to sign with the Capitals. “He said he’s really impressed and felt really good about Washington. That got my attention.”

The biggest question for Orpik, a two-time Olympian for the United States who will be 34 by opening night, will be reconciling his declining statistics with the terms of his deal. The contract included a limited no-trade clause, according to his agent, Lewis Gross. In Pittsburgh, Orpik’s ice time and possession numbers had dropped the past two seasons. But MacLellan saw a piece critical to Washington’s future, and projected him on both a shutdown pairing with John Carlson and as a defensive zone stabilizer for Mike Green.

“The total dollars were centered around Brooks,” MacLellan said. “We needed to get him in first because we thought that was our greatest need. We tried to get him to stay as low as possible. We struggled with that fifth year for a while, then we just felt we had to go there because it was getting so competitive on him.”

The Capitals had targeted Orpik and Niskanen long before hiring Reirden, but having the longtime Penguins blue-line coach offered familiarity to his former players. Though Reirden had flown back to Pittsburgh by the time free agency began and the deals were finalized, his presence was mentioned by both Orpik and Niskanen as reasons they took a longer look at Washington. Their first game against their old team will be on Dec. 27 in Pittsburgh.

“Todd helps guys, young defensemen get better,” Niskanen said. “He works on details extensively, builds your confidence. He tries to get the most out of everybody he works with.”

After focusing their efforts on the two defensemen, the Capitals decided against pursuing unrestricted free agent center Mikhail Grabovski, who spent 2013-14 in Washington on a one-year deal. MacLellan had previously called Grabovski’s initial contract demands “prohibitive.”

Less than a half-hour past the 12 p.m. start time, the Capitals announced a two-year, $1.9-million contract with goaltender Justin Peters, whose greatest success while at Carolina had come against the Capitals (seven games, two shutouts, .938 save percentage). The cost was relatively cheap in a saturated goaltender market, and MacLellan wanted a serviceable backup to Braden Holtby who wouldn’t threaten the 24-year-old’s confidence.

“We wanted to send a message to Holtby that he was our number one guy,” MacLellan said.

Peters and Orpik were the only two free agent candidates Washington interviewed in-house, though MacLellan said he spoke with “a few guys” on the phone. He also didn’t rule out adding a second-line center, though Tuesday’s signings left the Capitals with roughly $1.1 million in cap space.

Capitals notes: Washington also re-signed center Michael Latta to a two-year, one-way deal worth $1.15 million. He flipped between the NHL and AHL last season. . . . AHL defensemen Jon Landry, formerly of the Iowa Wild, and the Providence Bruins’ Mike Moore also signed one-year, two-way contracts on Tuesday, as did journeyman winger Chris Conner.