AUCKLAND, New Zealand — After 10,000 kilometers (6,000 miles) and almost 21 days at sea, only two minutes separated the first two yachts to finish the sixth leg of the Volvo Ocean Race on Wednesday after a difficult passage from Hong Kong Auckland.

AkzoNobel of the Netherlands crossed the finish line on Auckland’s Waitemata Harbour in the early hours of the morning, 20 days, nine hours, 17 minutes, 26 seconds after leaving Hong Kong and only 2 minutes, 14 seconds ahead of Hong Kong’s Scallywag.

In a remarkable finish, the first five yachts finished in a period of only 28 minutes after a ridge of high pressure off the east coast of New Zealand’s North island stalled the two leaders.

That allowed the remainder of the five-boat fleet to close in and threw the outcome of the leg into doubt as yachts headed towards the finish line.

AkzoNobel and Scallywag saw the big lead they had built over the past week quickly erode. But the leaders were just able to hold on as they match-raced towards the finish, often so close that crews could call to one another.

“It’s been a 6,500-mile match race, it’s unreal,” AkzoNobel skipper Simeon Tienpont said. “I’ve never sailed a race like this in my life. We’ve always been in each other’s sights. They (Scallywag) were always there. It’s been neck and neck. Huge respect to Scallywag, they never stopped fighting and we never stopped defending. I’m so proud of our crew, they never flinched.”

AkzoNobel’s first leg win of the race was a personal triumph for Tienpont who was fired before the leg began but reinstated after negotiation.

“It’s a great win,” he said. “I’m a sportsman and the only thing you want to do is win.”

Spain’s Mapfre finished in third place to retain the overall race lead ahead of China’s DongFeng Race Team. Scallywag’s second place, which followed a win on the leg into its home port of Hong Kong, lifted it into third place overall.

“Our team never gives up,” Scallywag skipper David Witt said. “We didn’t pull it off this time. We had our chances but AkzoNobel were just a little bit too good this time.”

The sixth leg was notable for the windless conditions crews encountered in the mid-Pacific, caused by a low pressure area left by a passing cyclone. Yachts were almost becalmed at times and briefly faced the prospect of food rationing on a longer than expected passage to Auckland.

Leg seven from Auckland to Itajai in Brazil begins on March 18.