SAN JOSE, Calif. - After 25 years, the San Jose Sharks will finally play for the Stanley Cup.

Captain Joe Pavelski scored an early goal, Joel Ward added two of his own and the Sharks advanced to their first Stanley Cup final in franchise history by beating the St. Louis Blues 5-2 on Wednesday night in Game 6 of the Western Conference final.

Joonas Donskoi also scored, Logan Couture had an empty-netter and Martin Jones made 24 saves as a Sharks team notorious for postseason letdowns will now play for the championship that has eluded stars such as Pavelski, Joe Thornton and Patrick Marleau for so many years.

Thornton assisted on Pavelski's goal less than four minutes into the game to set the tone and Marleau had two assists in the third period that set off chants of ''We Want The Cup! We Want The Cup!''

Game 1 of the Stanley Cup Final will be Monday night. The Sharks will either host Tampa Bay or visit Pittsburgh, depending on which team wins Game 7 of the Eastern Conference Final on Thursday night.

With the loss, the Blues' postseason woes continue as the franchise still seeks its first championship and first trip to the Cup final since 1970. Coach Ken Hitchcock's second goalie change of the series did not work as Brian Elliott allowed four goals on 26 shots in his return to the net.

Vladimir Tarasenko, a 40-goal scorer in the regular season, got his first points of the series when he scored twice in the third period but it was too late for the Blues, who still trailed 4-2.

Despite making the playoffs 16 times in 18 seasons and winning the second most games in the NHL since the start of the 2003-04 season, the Sharks have been known for their soul-crushing playoff disappointments.

They won just three games in three previous trips to the conference final, were knocked out twice in four seasons by an eighth seed and most notably blew a 3-0 series lead to lose in the first round to Los Angeles in 2014.

The impact of that loss lasted for an entire year as San Jose missed the playoffs entirely last season. But led by first-year coach Peter DeBoer and bolstered by some key acquisitions by general manager Doug Wilson, the Sharks recovered this year and are now only four wins away from a championship.

This was the first time in San Jose's history that the team played with a trip to the Stanley Cup Final on the line. The atmosphere in the Shark Tank reflected the high stakes with the fans at a frenzy during pregame introductions and the ''Let's Go Sharks!'' chants starting soon after the puck dropped.

The Sharks fed off that energy and were buzzing early as Hitchcock predicted before the game. St. Louis nearly silenced the crowd when Alexander Steen got a chance in the slot early in the period but Jones robbed him with a glove save.

That led to a breakaway for Thornton, who missed the net on his chance. But Pavelski recovered the puck behind the net and before Elliott knew what was happening, Pavelski tucked the puck in on a wraparound for his NHL-leading 13th goal of the playoffs.

San Jose added to the lead early in the second when Ward tipped a point shot from Brent Burns past Elliott to make it 2-0.

The Sharks had a chance to add to it when Scottie Upshall was called for a four-minute high-sticking penalty. But the Blues managed to kill San Jose's potent power play and started to take over the play after that. They couldn't get a goal the rest of the period, however, as San Jose kept them mostly to the outside and Jones made a great pad save against Jori Lehtera.

Ward's second goal and another by Donskoi in the third period removed any drama and allowed the fans to celebrate.

NOTES: Marleau played his 165th career playoff game, the most ever for someone who never played in the finals. Thornton is next on the list with 150 games, followed by Curtis Joseph with 133. ... The only franchise that has played longer than San Jose without going to a Cup final is Arizona, which began NHL play as the Winnipeg Jets in 1979-80.