Changing batteries in orbit took some huffing and puffing and some intricate maneuvering by two spacewalkers Friday. But in the end, it went almost as smoothly as doing the chore back on Earth.

NASA’s Anne McClain and Nick Hague took 6 hours and 39 minutes to replace three old nickel-hydrogen batteries with more powerful lithium-ion batteries on the International Space Station. They struggled with a stubborn bolt on the last battery plate, but eventually got the piece of battery equipment out and installed.

Despite the difficulty, the astronauts finished the job faster than NASA planned, so McClain got a chance to do a bit of unusual station cleaning. She took a scraper wrapped with sticky tape and picked up bits of tiny space debris attached to one section of the station.

The rookie spacewalkers had to be reminded to enjoy the view from about 250 miles up. Near the end of the spacewalk, astronaut Thomas Pesquet at Mission Control told McClain: “There’s the Earth right behind you.”

“I noticed. Beautiful,” McClain said.

As the spacewalkers were taking off their spacesuits, they got a surprise message from Hague’s wife, Air Force Lt. Col. Catie Hague: “You guys nailed it. Awesome job. Talk to you later. Love you.”

The station’s robotic arm had done much of the heavy work beforehand, but the astronauts still had to lug 300-pound pieces the size of a large coffee table and reconnect battery wiring.

There are more replacements of the 20-year-old station’s original batteries to come. NASA is about halfway through replacing 48 batteries with ones that are expected to last the remainder of the station’s life.

The space station uses solar panels to generate power but the batteries are used when it’s in the dark and not getting power from the sun.

Friday’s spacewalk was the first of three planned excursions to replace batteries and perform other maintenance. Next week’s spacewalk will include the first all-female crew, including McClain.

This was the 214th spacewalk to assemble and maintain the space station.

___

The Associated Press Health & Science Department receives support from the Howard Hughes Medical Institute’s Department of Science Education. The AP is solely responsible for all content.