SAN JOSE -- After opening the season with four decisive regulation wins by a combined score of 21-5, the San Jose Sharks got a far tougher test Saturday night, facing the fast and physical Ottawa Senators.

The Sharks survived, battling their way to a 3-2 victory, and so did their perfect record.

"They played hard," Sharks captain Joe Thornton said of the Senators. "They came at us, even though we scored the first goal, they came back. That’s a real good team over there."

Rookie Tomas Hertl, Patrick Marleau and Brent Burns each scored a goal for the Sharks.

The Sharks and Senators entered the third period tied 2-2, but Burns scored at 7:08, putting San Jose in front for good. Burns took a pass in front of the net from Thornton and ripped a shot past Senators goaltender Robin Lehner from point-blank range.

"Those are in my wheelhouse," Burns joked. "I've got those in my bag, empty netters. It was just a great play by (Thornton). I didn't have to do much, but I wasn't going to miss."

San Jose killed off a penalty late in the third and survived a furious Senators attack over the final minute-plus after they pulled their goaltender to win a physical and intense game against an Eastern Conference foe they hadn't played since Jan. 19, 2012.

Hertl scored his NHL-high seventh goal of the season 55 seconds into the game, but he was hurt with just over two minutes left in the second period in a collision with Clarke MacArthur. Hertl left the ice and did not return to the game. He was bent over with his head down, battling for a puck, when he and MacArthur collided.

Sharks coach Todd McLellan said Hertl appeared to hurt a shoulder, not his head. On Thursday night at Vancouver, he took a check to the head that cost the Canucks' Alexander Edler a three-game suspension.

"He fell into a player," McLellan said. "Basically he was going to the net, stumbled and fell into him. He's a little sore, but I think he'll be fine tomorrow."

Marleau scored a power play goal in the second period, his fourth goal of the season, and Sharks goaltender Antti Niemi stopped 21 of 23 shots.

Lehner, Ottawa's backup goalie, made his first start of the season and stopped 47 of 50 shots. He also received a four minute high-sticking penalty midway through the third period when he made contact with Burns' face, knocking out some teeth and drawing blood.

"Robin played real good," Senators coach Paul MacLean said. "We just can't continue to take penalties, especially the undisciplined kind, the ones we are taking. You can't expect the goalie to keep killing them off.

"We need to sustain our play. When we controlled play in the middle of the game we didn't sustain it and that's a concern. The last seven minutes of the first through the midway point of the second we played very well. Then we started turning the puck over and taking penalties. Against a team as experienced as that one, they are going to go after it."

Burns didn't blame Lehner for the high stick that cost him some teeth.

"He didn't mean to do it," Burns said. "He kind of came around the net the other way. I think he was trying to get back in his net, and I kind of cut across. I think it was putting his stick back in his blocker and it was kind of right up by the old melon. It was accidental. It didn't feel that good, though."

The Sharks took a quick 1-0 lead when Hertl knocked a rebound past Lehner from close range. Lehner stopped Dan Boyle's shot from near the blue line but couldn't control the puck, and Hertl made him pay with his seventh goal of the season.

Ottawa pulled even at 15:21 on Smith's goal from the slot. Sharks defenseman Matt Irwin tried to clear the puck from in front of the crease, but he sent it right to Smith, who was barreling in toward the goal. Chris Phillips and Colin Greening got the assists.

The Senators took a 2-1 lead at 17:58 when Ryan scored a power-play goal with Andrew Desjardins in the penalty box for high sticking. Spezza sent a cross-ice pass from near the lower left boards to Ryan in the right circle. Ryan beat Niemi with a laser that snuck inside the right post for his second goal of the season.

"I didn't think we were as sharp in this game as we were in some of the others and give them credit," McLellan said. "They did some good things. I also thought we started well and then played the middle of the game poorly, sloppily and tried to get a little too cute and then got back to the way we needed to for the third period."

The Sharks made it 2-2 at 16:12 of the second period on Marleau's power-play goal with Milan Michalek in the penalty box for tripping Logan Couture. Irwin fired a shot from the left circle and the puck rebounded off a mass of bodies in front of the net to a wide-open Marleau, who beat Lehner from the right circle for his fourth goal of the season.

"We played well 5-on-5," Lehner said. "We know they are good in the first period. They are good passers and you have to keep looking behind you. They are good at screening, at tipping and rebounding."

Couture was shaken up during that goal when Senators defenseman Jared Cowen knocked him backwards and on to the ice. Before the second period ended, Hertl was in the dressing room, and fellow rookie Matt Nieto was promoted to the top line with Thornton and Burns. Nieto got an assist on Burns' goal.

"I thought I adjusted pretty quickly," Nieto said. "They were really supportive and made me feel loose. It was great to play with those two."

Senators defenseman Joe Corvo, who was hit in the area of his left eye with a puck during the morning skate, was scratched. Eric Gryba was in the lineup, paired with Phillips. Sharks defenseman Brad Stuart served the second game of his three-game suspension for a check to the head of New York Rangers forward Rick Nash.