Tidal Bay got up in the final strides to land what looked an unlikely victory in a thrilling renewal of the Lexus Chase at Leopardstown.
Ruby Walsh got an amazing run out of the Paul Nicholls-trained gelding to pass several rivals on the run-in to give owner Graham Wylie a second Grade One on the card after Back In Focus took the Topaz Chase.
In a bunch finish, Tidal Bay (9-2) snatched the spoils from First Lieutenant with Flemenstar and Sir Des Champs just behind.
The Neil Mulholland-trained Midnight Chase made the running with Hidden Cyclone and Quito De La Roque on his heels and Tidal Bay held up in the rear.
Hidden Cyclone went on during the final circuit while Flemenstar appeared to be going ominously well as Peter Casey's stable star tried to take his winning sequence to eight, on his first try at three miles.
China Rock led two out, but Flemenstar was still going best and landed over the last with the race to win.
However, his stamina appeared to give out on the soft ground on the run to the line.
Tidal Bay still had a few lengths to find but he found what was necessary as Walsh produced him between horses, getting up to score by a head from First Lieutenant with Flemenstar third.
Sir Des Champs was just behind but his chances of success were not helped by his jumping.
Walsh said: "He jumped the second-last well and I got through the gap going to the last. He was really finishing and I thought I had a chance of getting to them.
"He was a bit flat-footed at the last and he took time to pick up, but when he did he started to fly and I guess 100 yards down I was thinking I was going to get there.
"Everyone was in the same boat. We all knew Flemenstar's stamina had to be tested and Midnight Chase went a good honest gallop and the tempo was upped all the way. It was a real true-run contest.
"He's a different horse this year. He won at Wetherby, was second in the Hennessy at Newbury and has come and won today. It's brilliant."
Casey said of Flemenstar: "Andrew (Lynch) said he pulled too hard. Maybe it would have been better if he had gone off in front.
"I don't think it was too far for him today. He boiled over a little bit. We had a job putting a saddle on him. He wasn't settled. Andrew said we'll have to go for the Hennessy and you have to do what the jockey says."