The owner of the New England Patriots football team is helping Massachusetts get from China protective masks for the coronavirus.

Two weeks ago, Gov. Charlie Baker negotiated a deal to acquire over a million medical-grade masks from a collection of Chinese manufacturers. His challenge was finding a way to bring them home.

Longtime friend of the governor, Jonathan Kraft, son of Patriots owner Robert Kraft and chairman of the board at Massachusetts General Hospital, offered Baker the team’s giant Boeing 767 airplane for the job.

It took several weeks of negotiations with various Chinese entities to acquire the proper permits and permissions to assure that the plane would be able to land in Shenzhen. Finally, an essential personnel only crew was flown to China to collect the masks.

“I’ve never seen so much red tape in so many ways and obstacles that we had to overcome,” Kraft told the WSJ.

At midnight on Wednesday, the plane landed in Shenzhen. No crew members were allowed to disembark.

Chinese workers in masks and full-body suits at Shenzhen Bao’an International Airport loaded boxes of the masks onto the plane.

The team plane was granted permission to be on the ground in China for a maximum of three hours. It required two hours and 57 minutes to load the plane with the 1.2 million N95 masks.

The plane is en route Thursday back to Boston Logan International Airport.

The Kraft family handled the logistics of acquiring permits for the plane, and agreed to pay $2 million for the masks. At Robert Kraft’s request, Baker has agreed to send 300,000 of the masks to New York.