James Tedesco has scored with 32 seconds left to give NSW a stunning 26-20 victory in the State-of-Origin decider to defend their shield.
Scores were locked at 20-all in the final minute, when Blake Ferguson tiptoed along the sideline, then found Tedesco for his second try of the night.
The drama came after Queensland forward Josh Papalii crossed in the 77th minute and debutant Ethan Lowe nailed a pressure conversion to level the game.
The dramatic finish ended a run of seven straight defeats in Origin deciders for the Blues, dating back to the start of the Maroons dynasty in 2006.
It is also Mitchell Pearce's first series win over Queensland in eight attempts.
NSW appeared headed for a comfortable finish, when Tedesco and Damien Cook broke an 8-all deadlock with tries in the space of nine minutes.
But the horrors of series past seemed to return, after Queensland scored twice in the final eight minutes, through Josh McGuire and Papalii.
When Lowe's conversion sailed through, Origin was seemingly set for its first golden-point contest in front of a sellout 82,565 crowd at Sydney's ANZ Stadium.
But Tedesco, who finished the night with a game-high 222 metres and 10 tackle busts, turned hero, with his game-winning four-pointer.
Tedesco, named Player of the Series, turned the game three times, beginning with a 65-metre kick return in the 34th minute to set up the Blues' first try.
The Maroons had started strongly and debutant Corey Norman turned that into points, forcing a line dropout and then grubbering for Felise Kaufusi to score.
More Maroons pressure resulted in a penalty goal - one of 12 infringements ruled by the referees in a frustratingly stop-start contest.
But Tedesco's kick-return set up Paul Vaughan to level the game at halftime, before producing his second-half heroics.