Scott Kelly and Kjell Lindgren return to the Quest airlock after over 7 hours outside the International Space Station Nov. 6.

Two American astronauts took a marathon spacewalk on Friday, spending nearly eight hours outside the International Space Station on a truly out-of-this-world plumbing job.

NASA astronauts Scott Kelly and Kjell Lindrgren spent seven hours and 48 minutes working outside the station to perform the vital maintenance on their spacecraft. It was their second spacewalk in nine days.

The duo's first-ever spacewalk last week, commanded by Kelly, had the two on separate tracks as they performed a variety of long-term maintenance tasks outside the station. This time around, commanded by Lindgren, they worked together, synchronizing their actions to reconfigure and add ammonia to the port-side station cooling systems — "high-flying plumbing," as NASA officials called it via Twitter.

This marks the 190th spacewalk outside the station, and a total of more than 1,192 hours of spacewalking time.

NASA astronauts Scott Kelly and Kjell Lindgren work together to remove a thermal cover on an external ammonia station during their spacewalk Nov. 6. (Image credit: NASA TV)

After aearly start, the astronauts first removed a thermal cover from part of the external ammonia station before splitting up to coordinate the disconnection of the cooling systems, each from a different location.

The astronauts' ultimate mission was to undo work from a 2012 spacewalk with astronauts Suni Williams and Akihiko Hoshide, where they rerouted ammonia away from the primary port-side cooling system's radiator to the backup system to try to stop an ammonia leak. The source of the leak was later identified as a faulty cooling pump, which astronauts Chris Cassidy and Tom Marshburn replaced in 2013 during a last-minute spacewalk with just two days of planning.

Astronauts have to be especially careful during operations involving ammonia because the substance is toxic to humans— any residue on spacesuits must be evaporated off before the mission ends. Lindgren noticed a few ammonia flakes while isolating the prime cooling system from the backup one, so near the end of the mission, they carefully inspected each other for any traces of the toxic substance.

Once the two systems were isolated and excess ammonia was cleared from the fill line, NASA ground control remotely opened a valve to begin topping off the backup system's supply of ammonia — a process that was set to take about 20 minutes. Kelly was prepared to manually close a valve and cut off the flow if they spotted any ammonia leaking out.

After that, they were able to top off the primary one, and ground control's cooling system officer reported a perfect fill on both.

The backup system holds about 90 lbs. (41 kilograms) of ammonia coolant, and about 6.8 lbs. (3 kg) were added, whereas the primary system holds about 54 lbs. (24 kg) and was topped off with 7.5 lbs. (3.4 kg), NASA officials said in the online webcast.

Meanwhile, Kelly struggled with some wire ties as he configured an equipment cart ("Somebody did a really good job on this wire tie here — like for all eternity," he quipped), and Lindgren retracted the backup radiator to its out-of-use position against the side of the space station.

They put away the cables, and Kelly investigated a strut connecting two parts of the space station's port side that had been vibrating and may have loosened — a bonus task. Then, they came together for the final part of the mission: to vent leftover ammonia from the plumbing lines used during the reconfiguring process. Excess ammonia would be left in a bag outside the station.

Lindgren helped Kelly untangle his restraints when they met up. "Lookin' good," he said.

"I'll buy you dinner back on Earth," Kelly said.

"You do all my work — I owe you dinner," Lindgren responded.

The duo weren't able to return and cinch the backup radiator in place against the side of the space station and add a protective shroud, so they had to re-extend and lock it to its full 44-foot (13 meters) length, even though it will not be used. NASA engineers said the radiator would not be at risk by staying outstretched.

Then, it was time for cleanup, taking inventory of their tools and heading in. On the way, Kelly set up the vent door to the ammonia reservoir so it could vent out extra ammonia if it were ever overpressurized.

Spacewalker Kjell Lindgren inspects Scott Kelly for ammonia residue outside the International Space Station as they wait for ammonia to vent from cables they used over the course of their "high-flying plumbing" excursion to reconfigure and top off space station cooling systems Nov. (Image credit: NASA TV)

Over the course of their work, the astronauts remained outside in sunlight long enough for any stray ammonia to evaporate, so they did not need any tests in the airlock or to stay outside longer for an extra "bake-out." Japanese astronaut Kimiya Yui and Russian cosmonaut Sergey Volkov helped them out of their suits once the astronauts repressurized.

Now, Lindgren and Kelly have a half-day break to recover before getting back to work. Lindgren is nearing the end of his first mission on the space station, and Kelly is 224 days into his one-year mission.

Email Sarah Lewin at slewin@space.com or follow her @SarahExplains. Follow us @Spacedotcom, Facebook and Google+. Original article on Space.com.