Yorkshire Carnegie were given a fright by bottom-of-the-table Championship rivals Richmond at the Athletic Ground before late tries from Seb Stegmann and Rob O’Donnell prevented a shock defeat.
Carnegie, who are chasing London Irish at the top of the table, looked to be cruising to victory as they racked up 22 unanswered points to secure the try bonus points inside the opening 20 minutes of the game.
However, a nightmare second quarter saw the home side bring the game back to within a point and the part-timers then took the lead at the start of the second half with a penalty.
Yorkshire took the lead inside the opening 90 seconds with a powerful run by number eight Ollie Stedman right through the heart of the Richmond defence to set up Max Wright for a try.
Two more tries soon followed as Pete Lucock created one for Jonah Holmes before finishing a move himself.
The try bonus point was secured after 19 minutes when quick hands put winger Stegmann in space and he raced through to score.
It seemed a side note that Joe Ford had only managed to convert one of his four attempts at that point but it soon after it became crucial.
Richmond finally woke from their slumber and worked two tries through their forwards to make the most of long spells of possession.
The first came from prop Jeremy Cunnew, with some nice footwork, before number eight Chris Davies barged his way over from close range.
With the final play of the first half, Richmond crossed for a third try with a catch and drive from the line out that saw Adam Peters touch down.
Full-back Rob Kirby crucially converted all three tries to make it 22-21 to the visitors at half-time.
Carnegie then handed Kirby the chance to give his side the lead when the restart was knocked on and collected in an offside position.
Kirby kicked the penalty to edge his side in front 24-22.
It remained that way until the hour mark when Richmond secured their own try bonus point with a well taken score by Kirby as he raced down the touchline to go over.
His conversion from the touchline hit the post and rebounded over.
Yorkshire needed a lifeline and it came in from the line out drive.
After back-to-back penalties, eventually Stedman peeled away and touched down. Ford’s conversion attempt hit the post but was short.
With eight minutes to go, Carnegie edged themselves in front with a superb break by Holmes creating the chance for Stegmann to score his second try.
Ford this time was on target from the touchline to give his side a three-point lead.
The result was secured in the final minutes when former Rotherham forward O’Donnell went over from ten metres out to complete a 39-31 win for relieved Carnegie.