Daryl Millard's last-minute try sentenced St Helens to their first defeat at Langtree Park as Catalan Dragons staged a superb fightback.
The French side trailed 26-8 when Saints ran in their fourth try five minutes after the break.
But Saints were then hit by a blitz of three French tries in eight minutes.
And, despite Gary Wheeler's second try to keep their noses in front, Catalans scored twice in the last 10 minutes through Setaimata Sa and Millard.
Scott Dureau's touchline conversion then took them to the top of Super League for the first time in their seven-year history, the Catalans outscoring their hosts six tries to five to maintain the only 100% record in Super League.
Saints were in complete command when they led by 18 points thanks to tries from Wheeler, Jamie Foster, who kicked six goals, Anthony Laffranchi and Tommy Makinson.
But the French outfit roared back with three quick tries from Damien Blanch, Vincent Dupport and Dureau to add to Remy Casty's early equalising try.
Then, in a sensational finish, St Helens centre Wheeler scored his second try to restore his side's eight-point lead but the never-say-die Dragons finished the stronger.
That meant a happy return for Leon Pryce, who scored 73 tries in 160 appearances for St Helens but was mostly subdued until calling on his vast experience in the Catalans' comeback.
Still trailing by four points as the hooter was about to sound, they threw the ball around like the Harlem Globetrotters to keep the ball alive before scoring the all-important try through Millard in the corner.
And, after video referee Steve Ganson had held a lengthy deliberation over the dazzling move, Dureau kept his nerve to land a touchline conversion to compelte an individual 14-point haul.
St Helens coach Royce Simmons, whose side conceded 36 points against Hull KR last Sunday, was once more critical of their defence but also pointed the finger at referee James Child and said he would be raising his performance with RFL officials chief Stuart Cummins.
VIEW FROM THE DRESSING ROOM
St Helens coach Royce Simmons:
"They're a very good side. I was never comfortable. I knew they had the strike power to come back. They have a lot of blokes in their side who can create something and turn half-chances into something. They had a crack at it and it was a tremendous effort by them.
"But it started to go wrong when we had four penalties in a row awarded against us. We didn't have much ball from that stage onwards. Some of the penalties were an absolute joke.
"If it's going to cost me money, I don't care. Stuart Cummins will be hearing from me. There were some really tough calls. I'm very disappointed with the referee's performance."
Catalan Dragons coach Trent Robinson:
"We were playing poor. St Helens were totally dominant and we just didn't have any flow to our game. But, as soon as we started to win a couple of plays, there was a bit more flow to our sets. That's when Ian Henderson started to pick up the tempo as well.
"We're still not a big team on the basics but it showed we can do stuff that other teams can't do. We can play with momentum and produce ad-lib footie. There was a lot of good instinctive play at the end.
"I looked at Scotty just before he took the kick and he was pretty calm. He was definitely in the moment. It's great credit to him."
St Helens: Wellens; Makinson, Shenton, Wheeler, Foster; Gaskell, Lomax; Laffranchi, Roby, McCarthy-Scarsbrook, Soliola, Wilkin, Puletua.
Replacements: Hohaia, Flannery, Flanagan, Clough.
Catalan Dragons: Greenshields; Blanch, Millard, Dupport, Bosc; Pryce, Dureau; Casty, Henderson, Paea, Sa, Menzies, Baitieri.
Replacements: Ferriol, Mounis, Raguin, Fakir.
Referee: James Child (Dewsbury).