New Zealander Lydia Ko completed the set of Olympic golf medals on Saturday after battling to a two-shot victory at Le Golf National during a tense final round to seal gold.

Ko was the only player in the last three groups to not collapse out of contention, carding a one-under-par 71 to edge German Esther Henseleit into second, with China’s Lin Xiyu taking bronze.

“Going into this week, everyone was saying, ‘Oh, what if you finish and collect the gold on top of the silver and bronze you have’,” Ko said. “Of course I wanted to do that, complete it, too, but it’s much easier said than done.”

The former world number one was cruising to the title, leading by five shots with six holes to spare before hitting an iron shot on the par-four 13th into the water and making a double-bogey. Henseleit took advantage, finishing with back-to-back birdies to sign for a closing six-under-par 66 and post an eight-under total in the clubhouse.

But Ko held her nerve, reeling off four successive pars before securing gold in style with a birdie on the par-five 18th hole, ending the tournament on 10-under overall. The 27-year-old was already the first golfer to win multiple individual Olympic medals and now has more in total than any other player in history.

Americans Chandler Egan, Burt McKinnie and Francis Newton took individual and men’s team medals in the 1904 Olympics in St Louis. Ko was runner-up behind Park In-bee when golf returned to the Olympics from a 112-year absence in Rio in 2016, before finishing third in Tokyo three years ago. She kept her rivals at arm’s length once she first reached 10-under with a 45-foot birdie putt on the seventh. Reigning champion Nelly Korda was in medal contention But the world number one hit a dreadful approach shot into the 15th green.