Castleford Tigers overturned a 16-0 half-time deficit to beat Wakefield Trinity 25-24 in a thrilling derby at Belle Vue.
Luke Gale's drop goal with 90 seconds left secured a 10th successive Betfred Super League win that moves the Tigers 10 points clear at the top of the table.
Ben Jones-Bishop touched down for the 17th time in the league this season and Kyle Wood crossed for a second try in the first half.
Greg Eden's 32nd try of the season was followed by Grant Millington going over as two tries in five minutes put Castleford back in the game.
79: DROP GOAL!! LUKE GALE!!! Trinity 24-25 Tigers. 90 seconds left pic.twitter.com/D1RQIE4DVR— Castleford Tigers (@CTRLFC) July 6, 2017
Mike McMeeken's try allowed Gale to kick his third goal and give the Tigers the lead for the first time.
Wakefield roared back with David Fifita bundling three defenders out of the way to touch down with 11 minutes left, but Jake Webster crashed over late on before Gale took his side to victory.
Castleford coach Daryl Powell: "We needed to change a few things at half-time. I'm not taking anything away from Wakefield, who pretty much dominated the first half, but our attitude was just not quite where it needed to be.
"We'd won nine games straight and I suppose it's human nature that you just dip a bit. It's a lesson for us that every week teams want to beat us.
"In the second half we looked completely different. Our attitude was better and we started to get our game together. To do what we did at the end showed a lot of character, it was a great response from us. The spirit was incredible and if we had lost by a point I would have said the same."
Wakefield coach Chris Chester: "It was a tale of two halves. It was probably the best 40 minutes we've played all season in the first half. We were very aggressive from the kick-off and really took it to their pack and came up with some really good play.
"We let it slip in the second half and didn't react quick enough to the momentum swing. I thought when big Dave went over, we were in for a good night but we just came up short in the last minute.
"It's a tough one to take because it's a derby but we're a good side and we can still get in that top four."