Bradford Bulls ended a three-match losing streak with victory against Catalan Dragons to progress to the Challenge Cup quarter-finals.
Catalans led 16-0 on 15 minutes from Daryl Millard, Ben Pomeroy and Olivier Elima tries but Lee Gaskell and Jamie Foster's brace turned the game around.
Luke Gale and Adrian Purtell added to the Bulls lead after half-time before Michael Oldfield reduced the deficit.
Foster's penalty, one of six goals, and a Gale drop goal sealed victory.
Bulls have had their problems on and off the field this season, sitting bottom of the Super League following a points deduction incurred shortly after the season began, but the cup has proved a welcome distraction.
Francis Cummins' side welcomed a Dragons team who had won their last four matches, and that form showed as they raced into an early lead.
Millard pounced on a mistake inside the first two minutes to cross, Pomeroy adding to the tally when he stepped Foster to ground the ball.
Elima then touched down against his former club, but it proved a false dawn for Catalans as Bradford turned the game around with a burst of tries.
Gale was the influence, threading a kick in behind to feed Gaskell and the scorer turned provider with a similar ball for Foster to dot down.
The former Saints winger went over again before the break and it was a similar story the other side of the hooter when Gale scampered in to extend the Bulls' advantage.
Purtell was put through by Adam O'Brien as Bradford exercised their control but Oldfield's try served as a warning of the Catalan threat.
Foster's successful kick for two eased the tensions, before Gale popped a drop goal over to secure a last-eight place for the men from Odsal.
Bradford coach Francis Cummins:
"I've never questioned the character of my players once but this is a real boost for the boys and my staff - it can be a lonely time when you get written off by everyone. This is a real positive for our club. Today even the fans, who've been really good, found their voice again.
"Character is a massive thing but we probably had a better mindset - we got them down the right end of the field and showed patience that we have not shown recently. We learned because we have been trying to knock them out with every play and they have taught themselves a lesson that they don't need to do that.
"They came up with some errors but I felt we forced them - our middle was great, although we had a couple of brain explosions early on the fringes, and Jay Pitts (making his debut after signing on loan from Hull in midweek) put in a great shift for his first game out."
Catalans coach Laurent Frayssinous:
"We played clinically at the start and we had guys running and some shape but after scoring the last try we switched off, took some short cuts and defensively we were poor.
"They fought back hard and got the win so credit to Bradford.
"My players were tired - we've had four games in two weeks and trained only two times this week - but it's normal at this time of year and the same for any team."
Bradford Bulls: Kearney; Kear, George, Purtell, Foster; Gaskell, Gale; Fakir, Diskin, Manuokafoa, Pitts, Addy, Walker.
Interchanges: Sidlow, O'Brien, Olbison, Henry.
Catalan Dragons: Escare; Oldfield, Pomeroy, Duport, Millard; Pryce, Barthau; Elima, Pelissier, Bousquet, Taia, Whitehead, Baitieri.
Interchanges: Anderson, Paea, Garcia, Guasch.
Referee: James Child (RFL).