Golden State Warriors star Stephen Curry surpassed Ray Allen for the NBA’s all-time record for three-pointers on Tuesday with two baskets from beyond the arc early in the game against the New York Knicks.

Curry matched Allen’s record with his 2,973rd three-pointer with 10:50 remaining in the first quarter with his first shot of the contest.

He missed a chance at breaking the record but minutes later he swished in number 2,974 to send the crowd at Madison Square Garden into a frenzy.

Curry let out a loud shout as teammates celebrated with him. He exchanged an emotional hug with coach Steve Kerr, who corralled the ball used in the record-setting shot, and then with his father, former NBA player Dell Curry.

Curry has been scorching towards overtaking Allen’s record for years. He finally surpassed the milestone on Tuesday in his 789th career game; Allen had achieved his old benchmark in 1,300 appearances.

Curry, whose mastery of the three-pointer has made the shot mainstream in the NBA, had been inching toward the record for a week.

Such is his long-range prowess there was real belief that he could perhaps break the record with a single-game mark of 16 in a home game against the Portland Trail Blazers last week.

That didn’t happen, and the Warriors departed on a road trip with Curry needing 10 three-pointers to break the record.

The 76ers’ swarming defence held Curry to three three-pointers last Saturday. He added two more at Indiana on Monday.

Curry, who said he knew teams would be keen to slow him, wasn’t disappointed to have a shot at the record at Madison Square Garden, perhaps the most storied arena in the NBA.

“I’ve had some fun nights in that building,” said Curry, whose 54-point performance there against the Knicks on February 27, 2013 was a harbinger of a career that now includes three NBA titles and two Most Valuable Player awards.

“The whole legacy of that building, how iconic it is – a lot of cool things have happened in that building.”

The atmosphere was electric before the game with Allen courtside and Reggie Miller, who held the three-point record for more than a decade before Allen broke it in 2011, on duty as a television commentator.

Both chatted and shared a hug with Curry before the game with filmmaker and Knicks super-fan Spike Lee catching the moment on his cellphone camera.