SAN JOSE, Calif. — Sidney Crosby let out a scream as he lifted the Stanley Cup above his head, a wide smile spread across his face.

The seven years of adversity since he last held the trophy were firmly in the past. The concussions that nearly derailed his career. The early playoff exits. The rough start to this season that led to a coach being fired.

Crosby and the Pittsburgh Penguins are once again champions.

A kid no more and surrounded with new talent, Crosby set up Kris Letang's go-ahead goal midway through the second period, and Pittsburgh won its fourth Stanley Cup in franchise history by beating the San Jose Sharks 3-1 in Game 6 on Sunday night. Owner Mario Lemieux thrust his hands into the air in triumph high up in an arena suite and later hugged his superstar on the ice.

This title had been a long time coming.

"I was just thinking about how hard it was to get to this point, just trying to enjoy every second of it," Crosby said. "It's not easy to get here. Having won seven years ago at a young age, you probably take it for granted a little bit. You don't think you do at the time, but it's not easy to get to this point."

Brian Dumoulin opened the scoring with a power-play goal, and Patric Hornqvist added a late empty-netter. Matt Murray made 18 saves to give the Penguins a championship seven years to the day after they beat the Detroit Red Wings for their third title. The game ended when Crosby cleared the puck the length of the ice with San Jose on the power play, setting off a wild celebration.

All that was left was for Crosby to accept the Conn Smythe Trophy as playoff MVP and then the Stanley Cup.

"He's a special player for a reason," teammate Chris Kunitz said. "He can adapt and change his game to different things. Early in his career he went out and got points and did everything, but that didn't make him satisfied. He had to go out and lead through example and became a better player."

Crosby immediately handed off the Cup to teammate Trevor Daley, who missed the final nine games of the playoffs because of a broken left ankle. Crosby said he gave it to Daley not because of the injury but because the 32-year-old defenseman's mother is battling cancer.

Daley told Crosby after a visit home that his mother, Trudy, wasn't doing well and wanted to see him lift the Stanley Cup.

"That was important to her. I think that kind of stuck with me after he told me that," Crosby said.

When it was time to celebrate Sunday night, Crosby told Daley he would be getting it first.

"I told him, 'No,' but he said, 'You got it first,'" Daley said. "'When I came out, he said, 'You're first to get it.' It was pretty cool.'"

Daley then handed the Cup to popular teammate Pascal Dupuis, who had to stop playing hockey several months ago because of blood clots. Crosby said it was special to have Dupuis around and that it meant a lot for the 37-year-old winger to raise the Cup again after they won it together in 2009.

Three nights after squandering a chance to become the first Pittsburgh team to win a title in front of the home fans in 56 years, the Penguins finished the job on the road just like they did in Minnesota (1991), Chicago (1992) and Detroit (2009) in past title runs.

The championship in Detroit was supposed to be the first of many for a team led by players like Crosby and Evgeni Malkin. But a series of concussions cost Crosby almost a season and a half, and there were playoff disappointments that included twice blowing 3-1 series leads. There was no second celebration in the Crosby era — until now.

"It's so hard to win it year after year," said Lemieux, who won back-to-back titles and Conn Smythe trophies as a player for Pittsburgh. "For them to be able to come through this year and win their second Cup is big. Hopefully there's a few more for them."

This didn't seem like it would be a season to remember in early December when the Penguins were near the bottom of the standings in the Eastern Conference and coach Mike Johnston was fired.

But led by coach Mike Sullivan, the Penguins recovered to make the playoffs as the second-place team in the Metropolitan Division after some shrewd moves by general manager Jim Rutherford, who put together the "HBK line" of Carl Hagelin, Nick Bonino and Phil Kessel over the past year and made other key acquisitions.

Pittsburgh knocked off the New York Rangers in the first round, eliminated the Presidents' Trophy-winning Washington Capitals in Round 2 and then rallied from a 3-2 series deficit to beat the Tampa Bay Lightning in the Eastern Conference finals.

"In the playoffs, suddenly we thought we could beat any team," Malkin said. "We tried to play the same game we played in 2009."

The Penguins were in control for almost the entire finals. They did not trail until Game 5 at home and responded to a strong push from San Jose in the clincher to avoid a decisive seventh game. Pittsburgh held San Jose to one shot on goal in the first 19 minutes of the third period to preserve the one-goal lead. The Penguins sealed it when Crosby blocked a shot from Marc-Edouard Vlasic that set up Hornqvist's empty-netter.

"You dream your whole life for this," said Kessel, the former Maple Leaf who led the Penguins with 22 points this postseason. "How can you ask for anything better than this? Winning the Cup is what your dream of and what you play for."

Logan Couture scored the lone goal for the Sharks, who were making their first trip to the finals in their 25-year history. Martin Jones made 24 saves and was San Jose's best player for the series.

"The end is like hitting a wall," coach Peter DeBoer said. "But only one team can win."

While the season ended in disappointment, it also was a bit of a breakthrough for Joe Thornton, Patrick Marleau and the rest of a franchise that had been known for playoff collapses, most notably in 2014 when the Sharks blew a 3-0 series lead in the first round to the Los Angeles Kings.

"We thought we had the team, going through the teams we did in the West," Thornton said. "It's just tough right now."

There was an electric atmosphere before the final home game of the season in San Jose with fans starting their "Let's Go Sharks!" chants well before the opening puck drop and an elaborate pregame light and video show firing up the fans. But the Penguins jumped ahead for the fifth time in six games this series after Dainius Zubrus was sent off for tripping when Crosby's line didn't allow San Jose to leave its own zone. Dumoulin took advantage when his point shot beat Jones for a rare soft goal allowed by the Sharks netminder.

The Sharks tied the game early in the period when Couture beat Murray with a big shot for his 30th point of the postseason. Pittsburgh answered 1:19 later when Crosby sent a pass from behind the net to Letang, who beat Jones from a sharp angle to the short side to make it 2-1.

Game notes
Sharks F Melker Karlsson missed a few shifts in the first period after falling awkwardly into the boards and limping off the ice. … Couture joined Philadelphia's Daniel Briere (2010), Malkin (2009) and Crosby (2009) as the only players in the past 20 years with 30 points in a postseason.

The Associated Press contributed to this report.