SAN JOSE, Calif. — Tomas Hertl scored a short-handed goal for the highlight reel and the Shark Tank started rocking on opening night. Then the Anaheim Ducks responded almost immediately and took over the game to spoil the party in San Jose.

John Gibson made 31 saves to keep the Ducks in the game through the first two periods and Rickard Rakell answered Hertl's goal with the first of Anaheim's four goals in the final 22 minutes to send San Jose to a 5-2 season-opening loss Wednesday night in Erik Karlsson's first game with the Sharks.

"It seized the momentum back for us," coach Randy Carlyle said about Rakell's equalizer. "Big power play. We turned the puck over and got beat to the net on the short-handed goal, but they picked themselves back up and said, 'Hey, that's not going to be a deflating moment.'"

Brandon Montour then broke the tie with 11:58 to go, Adam Henrique added a power-play goal and Carter Rowney scored an empty-netter as the Ducks responded after getting badly outplayed for most of the first two periods.

Max Comtois scored on his opening shift in the NHL and Jakob Silfverberg had three assists in the first game for the Ducks since getting swept in the first round by San Jose last spring.

"Not the prettiest win but we found a way," Henrique said. "We stuck to our game, kept pushing and found a way. Special teams came up big for us and Gibby came up big for us to and kept us in it the first two periods."

Hertl and Evander Kane scored for the Sharks but Martin Jones allowed four goals on the first 13 shots he faced to take the loss. Jones finished with 10 saves.

While Jones was barely tested, Gibson was kept busy all night and helped keep the Ducks in the game until Montour and Henrique scored in a span of 2:20 to break a 2-all tie. Gibson stopped Kane on a breakaway early in the third to maintain the tie.

Montour scored the go-ahead goal when he beat Jones with a backhand from the circle in transition to the short side to dampen the mood at the Shark Tank on a night the fans welcomed the two-time Norris Trophy-winning Karlsson to the team in his first game since being acquired from Ottawa last month.

"They did a good job in capitalizing on the chances that they got and we did not even though we created a lot of good things out there," Karlsson said. "It's the first game, now we've got some things to work on and we'll take it from there."

Henrique added a power-play goal a few minutes later and the Ducks went on to the win despite starting the season without four injured forwards: Corey Perry (knee), Ryan Kesler (hip), Patrick Eaves (shoulder) and Ondrej Kase (concussion).

While the Sharks' fans were excited to see Karlsson, it was the Ducks who struck first. Comtois scored 49 seconds into the game and 4 seconds after stepping on to the ice for the first time as an NHL player. Henrique got him the puck after a neutral-zone turnover by Brent Burns and Comtois beat Jones for the sixth-fastest goal by a player making his NHL debut.

"I wouldn't believe it if you had said that to me before the game," Comtois said.

The Sharks then took the lead with a pair of spectacular goals from Kane and Hertl. Kane struck in the first period when he brought the puck into the offensive zone against three defenders, deked Josh Manson and beat Gibson for the equalizer.

Hertl topped that late in the second period with the Sharks short-handed. He stole the puck in his own zone and carried it up ice. Hertl then played the puck between Cam Fowler's legs before beating Gibson for his second career short-handed goal.

The Ducks tied it 46 seconds later on the same power play when Silfverberg slid a pass through the crease to Rakell, who knocked it into the open net.

"We did a lot of good things," Sharks coach Peter DeBoer said. "The result wasn't there, and I know everyone is disappointed. Everyone wants to start out with a great win in front of our home crowd. We did a lot of good things but obviously there are some areas we need to clean up, too."

NOTES: Jones has allowed a goal on the first shot of the season three times in four years with the Sharks. ... The last player to score faster in his debut than Comtois was Alexander Mogilny, who did it 20 seconds into his first game Oct. 5, 1989, for Buffalo.

UP NEXT:

Anaheim: Visit Arizona on Saturday.

San Jose: Visit Los Angeles on Friday.

___

More AP NHL: https://apnews.com/tag/NHL and https://twitter.com/AP_Sports