SHANGHAI — Lin Yuxin struggled so much with the par-5 18th hole at Sheshan International that he thought it cost him in the Asia-Pacific Amateur.

He played it to perfection in the first sudden-death playoff in the 11-year history of the tournament, and his birdie on the second extra hole gave Lin the victory over defending champion Takumi Kanaya of Japan and allowed him to join Hideki Matsuyama as the only two-time winners of the Asia-Pacific Amateur.

In a playoff between the last two winners of Asia's biggest amateur event, Lin made a 7-foot birdie putt on the first extra hole at the 18th to extend the playoff, then won when he blasted out of a greenside bunker to 3 feet and made the putt.

The victory sends Lin to the Masters and the British Open next year.

"I'm happy to win this trophy back," said Lin, who won in 2017 when it was in New Zealand. "Just being able to get back to Augusta and the British Open, it's a great feeling. I can't wait to get back to those two amazing championships."

He won by three shots in 2017. This one was up for grabs until the final hole, with as many as six players in the mix on the back nine.

Lin had a one-shot lead going to the 72nd hole when he drove into a fairway bunker left of the fairway, and pulled his second shot into the water when trying to lay up. That led to bogey and a 4-under 68. Lin had made double bogey on the 18th hole on Saturday, and bogey on the 18th hole in Friday.

"It was not my friend for most of the rounds, in the hazard three days in a row," Lin said. "It turned out pretty good in match play."

He was fortunate just to get into a playoff. His bogey dropped him to 10-under 278, tied with Kanaya and Yung-hua Liu of Taiwan. Kanaya had a 7-foot birdie putt in regulation, but it missed on the left side.

Kanaya made an 18-foot birdie putt on the first extra hole, forcing Lin to make his 7-foot birdie putt to extend the playoff. Lin finally hit the fairway on the 18th on the second playoff hole, and his length allowed him to go for the green and put his second shot in a bunker left of the green to set up the birdie.

Liu, playing in the final group, had 110 yards to the pin for his third shot and needed birdie to win. His wedge hit the top of the ridge and spun down the slope to 40 feet, and he three-putted for bogey for a 71 to miss out on the playoff.

Lin becomes the third player to win in his home country. Antonio Murdaca of Australia won at Royal Melbourne in 2014, while Matsuyama won his first Asia-Pacific Amateur at Kasumigaseki Country Club — the course of the Olympics next summer — in 2010.

With a four-way tie for the lead, the final round at Sheshan International figured to go down to the final hole, except that none of the four made it to the playoff.

Liu had the best chance. He birdied four of the opening five holes to seize control, only to make double bogey on the ninth hole when his approach rolled over the back of the green and nestled against a collar of thick rough. He stubbed his chip, hit the next chip 6 feet by the hole and missed.

Even so, Liu had a chance to win it on the par-5 18th until three-putting for bogey, missing a 5-foot par putt that would have put him in the playoff.

Lin took the lead with a birdie on the par-5 14th, and he looked to have the winning touch down the stretch. From a collar just above the bunker on the reachable 16th, he hit a punch-and-run away from a pot bunker and onto the green to 7 feet, making birdie to reach 11 under. Then, he saved par with a 7-foot putt on the par-3 17th.

But from a fairway bunker on the 18th, he was too aggressive and pulled the shot into the water. Lin reached the front of the green and two-putted for a bogey.

James Leow of Singapore also had a chance. He drove the 16th green and made a 20-footer for eagle and was one behind playing the 18th. He laid up in the rough, and his wedge to the green went over the back, down the slope and into the water, leading to double bogey and a 69. He wound up two shots out of the playoff.

Lin's victory means Chinese players now have four titles in 11 years at the Asia-Pacific Amateur. Along with his two victory, Guan Tianlang won in 2012 and Jin Cheng won in 2015. Japanese players have won three times.

The 120-man field featured players from 39 countries and territories across the Asia-Pacific region.