In this image made from video provided by NASA, U.S. astronauts Peggy Whitson, above, and Shane Kimbrough work on the outside of the International Space Station on Thursday, March 30, 2017. An important piece of micrometeorite shielding was lost during the spacewalk. (NASA via AP)

Spacewalking astronauts carried out an impromptu patch job outside the International Space Station on Thursday, after losing a vital piece of cloth shielding when it floated away.

As the drama unfolded, Peggy Whitson set a record for the most spacewalks by a woman—eight—and the most accumulated time spent spacewalking—well over 50 hours.

The bundled-up shield somehow came loose as Whitson and Shane Kimbrough worked to install micrometeorite protection over a spot left exposed when a new docking port was relocated. Mission Control monitored the shield as it drifted away and, a couple hours later, determined it posed no risk to the 250-mile-high outpost. It was visible in the distance as a white dot.

As Whitson and Kimbrough installed the three remaining shields, Mission Control quickly came up with a TV MacGyver-like plan for a patch. The astronauts filled the gap using the cover that they had just removed from the relocated docking port.

The cover is made of the same material as the shielding, according to Mission Control, and just as capable of protecting against potential strikes by bits of space debris and providing thermal control.

It was not immediately clear how the shield got away, said NASA spokesman Dan Huot. It's supposed to be tethered to the station or spacewalker at all times. Frustration was evident in Whitson's voice as she told Mission Control about the mishap. She was delighted, though, by how well everything turned out.

In this Thursday, Nov. 17, 2016 file photo, U.S. astronaut Peggy Whitson, member of the main crew of the expedition to the International Space Station, waves from a bus prior the launch of Soyuz MS-3 spaceship at the Russian leased Baikonur cosmodrome in Kazakhstan. On Thursday, March 30, 2017, Whitson set a record for the most spacewalks by a woman, eight, as she works on preparations for a new docking port on the ISS. (AP Photo/Dmitri Lovetsky, Pool)

"You guys came up with a fantastic plan—on short notice. That's amazing," Whitson radioed.

Spacewalkers have lost things before, including an entire tool kit in 2008. But the getaway items are usually small, like bolts. The lost fabric shield is relatively large: It weighs 18 pounds and, when unfolded, measures about 5 feet by 2 feet and is about 2 inches thick. It eventually will re-enter the atmosphere and burn up.

The entire space station is protected, in some fashion, against possible debris strikes.

The relocated docking port will serve as one of two parking spots for commercial crew capsules under development by SpaceX and Boeing. It was disconnected during a spacewalk last Friday by Kimbrough, the space station's commander and a six-time spacewalker. Then flight controllers in Houston moved it to a new and better location Sunday. The spacewalkers hooked up heater cables to the port Thursday.

This still image taken from NASA shows NASA astronaut Peggy Whitson during a space walk at the International Space Station on Thursday, March 30, 2017. Whitson, the world's oldest and most experienced spacewoman has just set another record, her eighth spacewalk. Whitson and her spacewalking partner, Shane Kimbrough need to complete prep work on a docking port. (NASA via AP)

Midway through the outdoor excursion, Whitson surpassed the record for women of 50 hours and 40 minutes of total accumulated spacewalking time, held by former station resident Sunita Williams. Williams is one of four NASA astronauts who will make the initial test flights of the SpaceX Crew Dragon and Boeing Starliner capsules. The first flight could occur as early as next year.

A Russian holds the all-time spacewalking record: Anatoly Solovyev with 16.

The 57-year-old Whitson has been in orbit since November. This is her third space station stint. Altogether, she's spent more than 500 days off the planet, also more than any other woman.

She's scheduled to return to Earth in June, but may stick around an extra three months, until September. NASA is hoping to take advantage of an extra seat in the Russian Soyuz spacecraft that's due to launch with two astronauts next month and return in September.

NASA, meanwhile, has indefinitely delayed a spacewalk that had been scheduled for next week. A shipment with replacement parts needed for that spacewalk is on hold because of rocket concerns at Cape Canaveral, Florida. Shipper Orbital ATK is relying on the United Launch Alliance's Atlas V to haul up the goods.

In this image made from video provided by NASA, U.S. astronauts Shane Kimbrough, left, and Peggy Whitson, install a shield on a relocated docking port outside of the International Space Station on Thursday, March 30, 2017. An important piece of micrometeorite shielding was lost during the spacewalk at another part of the station earlier in the day. (NASA via AP)

© 2017 The Associated Press. All rights reserved.