CHICAGO (AP) — Seth Jones was frustrated after he missed the net on a prime scoring opportunity in the second period. The All-Star defenseman felt a lot better when the game was over.

Jones scored two goals, including the winner 2:24 into overtime, and the Chicago Blackhawks rallied for a 4-3 victory over the Buffalo Sabres on Tuesday night.

Buffalo (21-19-3) lost for the fifth time in six games. Tage Thompson, Victor Olofsson and Peyton Krebs scored for the Sabres, and Craig Anderson stopped 22 shots.

Olofsson tied it at 1 when he knocked in a loose puck in front at 12:15, and Buffalo grabbed the lead on Thompson’s goal with 6.9 seconds left in the first. Jeff Skinner passed it over to Thompson, who eluded Jones before poking it in.

It was Olofsson’s third goal in his last four games and No. 18 on the season. He has five goals in five career games against Chicago.

Thompson scored his 32nd goal in 43 games after he had a career-best 38 in 78 games last season. He had no goals and two assists in his previous five games.

The Sabres opened a 3-1 lead 6:21 into the second when Krebs converted a slick backhand on a breakaway. Blackhawks forward Max Domi set up Krebs’ first career short-handed goal with an ugly turnover.

Chicago trailed 3-1 after two periods, but Jones rallied the Blackhawks in the third. Kurashev got a piece of Jones’ shot for his sixth goal at 1:34, and Jones tied it at 3 with a long wrist shot from the from the point with 56 seconds left.

Anderson was screened by Blackhawks forward Tyler Johnson on Jones’ third goal of the season, and the goaltender felt there should have been an interference call.

“On the replay, from what I’m seeing, obviously I don’t make the calls, but his left foot’s in the crease, his elbow goes into my glove, not allowing my glove to make the save,” said Anderson, a native of nearby Park Ridge.

Buffalo defenseman Mattias Samuelsson had a shot go off the post before Jones’ tying score.

“Couple goalposts in the third period, so it wasn’t like we sat back in the third period by any means,” Sabres coach Don Granato said. “But we didn’t bear down on our chances.”

Buffalo hosts the New York Islanders on Thursday night. Ryan Miller’s No. 30 jersey will be raised to the rafters of KeyBank Center during a pregame ceremony.

The Blackhawks (12-26-4) won for the fourth time in five games, closing out a 4-3-0 homestand.

Philipp Kurashev had a goal and two assists for Chicago, which was coming off an ugly 8-5 loss to Seattle on Saturday. Connor Murphy also scored, and Petr Mrazek made 30 saves.

“We’ve been home for a while, so we wanted to leave a good taste in the fans’ mouth and give them a show and give them a win tonight,” Jones said.

A streaking Jones took a pass from Johnson in overtime, and his backhand got under Anderson before sliding over the line. Jones yelled and pumped his arm after the puck went in.

“It’s nice to see a few go in,” he said.

Chicago jumped in front on Murphy’s fourth of the season. The defenseman got a nice pass from Kurashev and beat Anderson with a wrist shot from the right circle 8:41 into the first.