Leeds coach Brian McDermott admitted the best team lost after Liam Sutcliffe's last-second penalty earned his side a 32-31 win over Catalan Dragons that keeps them just a point behind First Utility Super League leaders St Helens.
McDermott was resigned to a second successive home defeat after Morgan Escare's 77th-minute drop goal edged the Frenchmen into a 31-30 lead and within touching distance of the club's first win at Headingley at the 10th attempt.
But the Dragons paid for a lack of composure, conceding two penalties in the last two minutes, which enabled Leeds to set up the position for Sutcliffe to land the winning kick from 30 metres out.
McDermott was full of praise for the 19-year-old Sutcliffe, who was handed the responsibility of goalkicking as well as the playmaking duties in the absence of skipper Kevin Sinfield, who missed only his second game of the season with a stiff back.
"That wasn't an easy kick," McDermott said. "It was a big moment in his career, holding his nerve like that. That will be something he will look back on and have some memory of, how to handle those moments.
"I'm not saying I was confident he would kick it but I knew he wouldn't fluff it.
"I thought even the ones he missed from the sidelines he gave every chance. He wasn't miles off with them either."
Leeds, who conceded a try to Catalan's exciting full-back Escare in the second minute, were trailiing 20-8 at one stage and did not take the lead until the 66th-minute when centre Joel Moon intercepted a Leon Pryce pass to score his second try.
Pryce made amends by creating a late try for winger Daryl Millard and Australian scrum-half Sam Williams - who enjoyed an impressive full Super League debut - set up the nerve-jangling finish by kicking his fifth goal from the touchline.
Second rower Zeb Taia had earlier scored two tries and hooker Eloi Pelissier also breached the best defence in Super League.
"What we did defensively at the start of the year was great but I knew we wouldn't keep that up," added McDermott, whose side has conceded more than a century of points in their last four league games.
"I'm not happy at conceding 31 points but we were playing a very good Catalan team.
"They're a form team, they have a huge amount of momentum behind them and I thought they performed better than us throughout the game. Certainly the full-back caused us a huge amount of problems.
"So I'm comfortable with the win. We scored more tries than them and, while we weren't great and while I had resigned myself to the loss and we feel fortunate to have won, I'm not ashamed either.
"We were in the mix throughout that game and there are things we can work on."
The Dragons had gone into the game with just one defeat in their last 10 league matches and coach Laurent Frayssinous was able to take some consolation from the shattering loss.
"I'm disappointed not to go back to France with the two points but obviously I'm pretty happy with the performance," he said. "Scoring 30 points against the best defence in the comp means something for us.
"I thought we deserved more.
"We lacked smartness and composure in the last two minutes but it's hard to criticise any of my players because they had a dig. We need to keep on learning because it was the same at Widnes three weeks ago."