St Helens beat Super League leaders Leeds in front of a bumper crowd of over 17,000 at Headingley to reach the fifth round of the Challenge Cup.
Saints scored first through Ade Gardner and although Leeds went ahead through Jamie Jones-Buchanan's converted score it was the only time they led.
James Roby's converted try and a Paul Wellens penalty made it 12-6 to Saints.
Tries from Wellens and Matt Gidley gave them a decisive lead and Brent Webb and Keith Senior's tries were not enough.
With the two sides separated only by points difference in the league the cup encounter was always going to be a fiercely contested affair, but on the day Saints were the sharper side.
Gidley crowned an influential display with Saints' fourth try
Leeds nearly took an early lead but Scott Donald was tackled into touch just feet short of the line and it was the visitors who broke the deadlock in the 13th minute.
Former Australia international Gidley beautifully created space for Gardner on the right flank and the winger dived over for the first try of the match.
Wellens missed the conversion from the touchline and the visitors fell behind when Jones-Buchanan latched on to Kevin Sinfield's precise grubber kick.
He managed to touch down despite the attentions of Gidley and Sinfield's conversion edged the hosts into the lead a quarter of the way through the match.
Saints should have hit back immediately but after freeing Gidley down the right his pass to the unmarked Gardner was forward.
Saints relieved to clinch cup-tie
However, they were soon back in front as Roby, who had just come off the interchange bench, made a sharp run from dummy half and Wellens converted to restore the visitors' lead.
They went 12-6 up early in the second half when Wellens added a penalty goal after Leeds were harshly penalised for stripping the ball in the tackle.
Leeds came within a yard of hitting back after a superb Rob Burrow break but Wilkin, playing out of position at stand-off, immediately pinned them back with a 40-20 kick.
From their put-in at the resulting scrum Wellens sliced over out wide and they soon added a third try as Gidley went over.
Wellens could not land either conversion but at 20-6 with just over 20 minutes to play it looked like a decisive lead.
The better side won - McClennan
Leeds were in no mood to go down without a fight and they hit back when Senior made a fine break down the left and Webb was in support to race over from 30m.
Sinfield converted to cut the gap to eight points but Saints restored the advantage through a Wellens penalty goal.
Leeds gave themselves a glimmer of hope when Senior crossed for a converted try inside the final minute, but a brave last-gasp attack came to nothing and it is Saints who go into the hat for the fifth round.
The crowd of 17,689 for the match was the biggest attendance at this stage of the Challenge Cup since 1994.
Leeds coach Brian McClennan:
"We were beaten by the better side on the day. They tied up our middle and got to the edges well.
"We made a couple of errors and paid for it. We gave away too many penalties as well. It was a bit of our own doing but also good work by St Helens.
"The cold hard truth is that we didn't play well enough on the day and that's what you have got to do."
Saints boss Mick Potter on stand-out Jon Wilkin:
"Jon is a very good player. I think you could put him in any position from one to 13 and he would do a very good job.
"I know he can kick a ball very well. He is very good at kicking and passing and just carrying the footie. He is a big asset to the team."
Peacock for Leuluai (49), Lauitiiti for Diskin (32), Buderus for Peacock (32), Buderus for Jones-Buchanan (72), Kirke for Ablett (35), Burgess for Kirke (61), Burgess for Lauitiiti (16), Ablett for Lauitiiti (65), Leuluai for Burgess (35), Kirke for Burgess (73), Diskin for Buderus (52).
Ashurst for Graham (35), Roby for Cunningham (25), Cayless for Hargreaves (23), Fa'asavalu for Hargreaves (72), Cunningham for Puletua (56), Ashurst for Puletua (75), Clough for Flannery (77), Fa'asavalu for Clough (30), Hargreaves for Fa'asavalu (49), Puletua for Ashurst (65), Graham for Cayless (48).
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.