Steven Brown carded a bogey-free 66 in dramatic circumstances to claim a first European Tour win at the Portugal Masters.
The Englishman had not registered a top-10 finish all season when he arrived in Vilamoura and needed a good result to even have a chance of breaking into the top 115 on the season-long Race to Dubai and keeping his playing privileges for 2020.
After an opening 69 on Thursday, he produced a season's-best 67 on day two and then went two shots better on Saturday, but he was three shots off the lead and provisionally short of moving up from 150th into the top 115.
South Africa's Brandon Stone started day four with a two-shot advantage and he still held that at the turn, with Brown remaining three back despite birdies on the second and ninth.
Another Brown gain on the 11th moved him inside the top 115 for the season and when he put his second shot on the par-five next to four feet for an eagle, he was just a shot off the lead at 17 under.
The 32-year-old then showed nerves of steel to par his way home and, with Stone dropping shots on the 13th and 16th, he had secured the trophy and his job for next season.
"You just never know with this game," he told europeantour.com. "It's crazy to think how well I've played the last month to how bad it was the first two thirds of the year.
"I never thought this was going to happen. I was just counting down ready for Tour School to get my game ready for that.
"The last few weeks I've had a calmness in my head. Even today, I liked the fact that I had to go for it and I wasn't just trying to have a good result. That's probably the difference."
Justin Walters finished alongside countryman Stone at 16 under, moving up from 121st to keep his playing privileges for 2020.
England's Chris Paisley finished at 14 under, a shot clear of compatriot Eddie Pepperell and two ahead of five more Englishmen in Oliver Fisher, Tom Lewis, Jack Singh Brar, Andy Sullivan and Matt Wallace.
Singh Brar moved up from 117th to 109th on the Race to Dubai to keep his place on the European Tour, but countryman Lee Slattery was one of five players to fall the wrong side of the line.