Phil Mickelson gives a thumbs up as he walks to the 18th hole on his way to winning Sunday’s Scottish Open, ending his 20-year wait for a victory in Europe.

INVERNESS, Scotland — Phil Mickelson birdied the first playoff hole to beat Branden Grace and win the Scottish Open on Sunday, ending his 20-year wait for a victory in Europe.

After three-putting the 72nd hole to miss out on a win in regulation, Mickelson produced a superb pitch from 45 yards that landed within a foot of the 18th pin, leaving Grace a 25-footer to match him.

Grace’s putt rolled by the hole and the 43-year-old American was able to celebrate a 48th professional victory worldwide, with his wife and three children watching on.

“I almost let it slip away, but to come out on top feels terrific,” Mickelson said.

Mickelson was using the tournament to hone his game ahead of next week’s British Open at Muirfield, and he looks in great shape to challenge for a first claret jug and fifth major title.

He should tee off on Thursday as No. 5 in the world and $740,000 richer.

Mickelson and Grace shot 3-under 69s in the final round to finish on 17-under 271 and overtake overnight leader Henrik Stenson, who bogeyed three of his last six holes for a tie for third with unheralded Dane J.B. Hansen on 15 under.

Mickelson had to dig deep to earn his first win on European soil since a capturing a title in Paris on the European Challenge Tour in 1993.

When Mickelson drove into the rough on the first hole, topped his second shot and then three-putted, he dropped four shots behind Stenson, who started in a manner befitting his nickname “The Iceman” in the toughest conditions of the week.

After three calm and sunny days, the wind had picked up off the Moray Firth coastline and made the Castle Stuart course much more challenging. Only five players shot lower than 70.

Mickelson was in more trouble when his chip from just off the third green came up short and rolled back down the hill to his feet. He was now five shots off the leader.

Urged on by a Scottish crowd that has really taken to the American — a long-time supporter of this tournament and a lover of Scotland and its links courses — he birdied the next three holes and then picked up shots at Nos. 11, 12 and 14 to take the sole lead, after briefly sharing it with Stenson and Hansen.

With the two Scandinavians dropping shots coming home, Grace became Mickelson closest challenger, but the American only needed to par the 72nd for victory.

He reached the green serenely in three, but slid a putt 5 feet by the hole, and again back up.

“I was so mad at myself after mentally losing my focus,” said Mickelson, who embraced his family before returning back up the 18th hole where he was forced to wait to tee off again after organizers had removed the tee markers, clearly confident Mickelson would finish the job the first time around.

Mickelson held his nerve in the playoff, though, with his approach shot bringing roars of approval from fans in the grandstands.

“The people here in Scotland have treated us so well,” he said. “I’ve really enjoyed my time here.”

He now hopes to take his form into Muirfield.

“Although I did a lot of things well, I have certainly things to work on,” he added. “Today was great for us to have this type of weather.”

Hansen briefly held the lead midway through the last round — although he had looked quite unlikely to be there. He found the bushes twice on the second fairway — forcing him to take two penalty drops — and then chipped short of the green with his sixth to wind up with a quadruple-bogey nine.

No one has ever won on the European Tour after making that score in his final round and he couldn’t alter that stat, despite reeling off seven birdies on his next eight holes.