The International Space Station got a power upgrade today (March 22) as two NASA astronauts took a spacewalk to install new batteries on the station's solar arrays.

NASA astronauts Anne McClain and Nick Hague — both rookie spacewalkers — emerged from the Quest airlock at 8:01 a.m. EDT (1201 GMT) before spending 6 hours and 39 minutes working in the vacuum of space. The spacewalkers replaced six old nickel-hydrogen batteries with three new lithium-ion batteries on the station's P4 truss, a segment that is connected to one of the eight solar arrays. The aging nickel-hydrogen batteries have been on the International Space Station for almost 12 years, lasting well beyond their expected lifetime of 6.5 years.

Today's spacewalk was the first in a series of three spacewalks scheduled to take place this month. Next Friday (March 29), McClain and NASA astronaut Christina Koch will tackle another spacewalk that will be almost identical to today's, only they will be working on another one of the eight power channels. That will be the first all-female spacewalk in history. A third spacewalk, scheduled for April 8, will tackle a different kind of power upgrade — Hague and Canadian Space Agency astronaut David Saint-Jacques will be working to establish a redundant power supply for the Canadarm2 robotic arm, a 58-foot (18 meters) robot used to grapple and release visiting spacecraft.

Related: Expedition 59: The Space Station Mission in Photos

Image 1 of 10 NASA astronaut Anne McClain emerges from the Quest airlock at the beginning of today's spacewalk. (Image credit: NASA TV) Image 2 of 10 NASA astronaut Anne McClain moves to the S0 truss to store a bag before getting to work with the batteries. (Image credit: NASA TV) Image 3 of 10 NASA astronaut Nick Hague heads over to assist McClain after her tether gets caught on something. (Image credit: NASA TV) Image 4 of 10 NASA astronaut Anne McClain's reflection is visible on the surface of the HTV-7 external palette. (Image credit: NASA TV) Image 5 of 10 NASA astronauts Anne McClain and Nick Hague work outside the HTV-7 external palette. (Image credit: NASA TV) Image 6 of 10 NASA astronauts Anne McClain holds one of the three adapter plates that was installed during today's spacewalk. (Image credit: NASA TV) Image 7 of 10 NASA astronauts Anne McClain (right) and Nick Hague work to connect cables between an adapter plate and a new lithium-ion battery. (Image credit: NASA TV) Image 8 of 10 NASA astronaut Nick Hague works on his "get-ahead" task at the end of today's spacewalk. (Image credit: NASA TV) Image 9 of 10 NASA astronaut Anne McClain works to clean debris outside the Unity module. (Image credit: NASA TV) Image 10 of 10 Canadian Apace Agency astronaut David Saint-Jacques and NASA astronaut Christina Koch open the hatch to the Quest airlock to let their spacewalking colleagues back inside the space station. (Image credit: NASA TV)

The first two Expedition 59 spacewalks are part of an ongoing process to upgrade the space station's power system. Upgrades began with a set of spacewalks done by Expedition 50 astronauts in January 2017 . NASA astronauts Peggy Whitson and Shane Kimbrough and European Space Agency astronaut Thomas Pesquet swapped out 12 nickel-hydrogen batteries with six lithium-ion batteries on the S4 truss segment, located on the other side of the space station.

Pesquet served as the spacewalk communicator during today's spacewalk and walked them through all their tasks from the flight control room at NASA's Johnson Space Center in Houston. "You know there’s the Earth right behind you," Pesquet told McClain as she was working outside the orbiting laboratory. "I know this — it’s beautiful," McClain replied.

After this trio of spacewalks, NASA plans to conduct at least four more spacewalks later this year to do the same battery replacement work at the P6 truss segment, located on the far end of the station's port side. Then in 2020, spacewalkers will wrap up the power upgrades by swapping out the final set of batteries on the S6 truss, which is on the far end of the station's starboard side.

This NASA infographic shows where all of the separate sets of batteries are located and when they will be (or already were) replaced. (Image credit: NASA)

While brave, spacewalking astronauts are paramount to completing these power upgrades, they couldn't do it on their own. Before they head out into the vacuum of space, these spacewalkers received a "hand" from Canadarm2, which did most of the "heavy lifting" of the 428-lb. (194 kilograms) lithium-ion batteries.

Of course, heavy objects don't really weigh anything when they're floating around in microgravity. However, lugging these enormous batteries around the station — they're each about the size of a small refrigerator — would involve more spacewalking time, which not only takes time away from the science experiments they're conducting inside the station, but also increases the amount of time that astronauts spend doing risky business outside the orbiting laboratory.

"Most of this work we prefer to do as much of it robotically as possible, and that's both to reduce the risk of sending crewmembers outside for multiple EVAs, and also it is a really good exercise and use of our robot arm and the capabilities we have associated with that," Maggie Lawrence, the flight director for today's spacewalk, said in a briefing on Tuesday (March 19).

The Canadarm2 robotic arm is fully extended in this photo by Canadian Space Agency astronaut David Saint-Jacques. (Image credit: CSA/NASA)

Ground controllers at the Johnson Space Center used Canadarm2 to remove the old batteries from the power channel and bring over the new lithium-ion batteries from an external pallet that was brought to the station with the Japanese HTV-7 cargo spacecraft last September. So, instead of having astronauts lug them around the outside of the station, all the astronauts had to do was install the new batteries with the adapter plates and store the old batteries on top of them.

Nine of the 12 batteries that will be replaced by the end of the second spacewalk will depart the station on a future HTV spacecraft, and they will burn up in the atmosphere as they fall back to Earth. The remaining three batteries will stay stored outside the station permanently, NASA TV commentator Rob Navias said during a live webcast of today's spacewalk.

McClain and Hague worked quickly and efficiently, finishing their main tasks well ahead of schedule. They did experience one minor hiccup when McClain encountered a "stubborn bolt" on the third and final adapter plate. The spacewalkers struggled with the bolt for nearly half an hour before McClain finally shook it loose — and they were still more than 20 minutes ahead of schedule by the time they moved on to optional "get-ahead" tasks.

"This crew lock bag is too small after carrying the adapter plate around," McClain joked as she finished up her work at the P4 truss. "Things always get better," Pesquet replied from his post down on Earth.

NASA astronaut Anne McClain works to clean debris outside the Unity module. (Image credit: NASA TV)

For her first "get-ahead" task, McClain headed over to the Unity module to clean up some debris using Kapton tape. Some debris had been spotted on Unity's common berthing mechanism, which is where Cygnus cargo vessels dock. (There is currently no Cygnus docked at the station, but one is scheduled to launch April 17.)

Meanwhile, Nick Hague went off on his own to work on tying back some restraints on a blanket box located on the P4 truss segment's solar array. Those launch restraints that have been there since that solar array launched to the space station in 2006.

With both of the astronauts having their first successful spacewalk under their belt, they have each accrued a total of 6 hours and 39 minutes of spacewalking time. McClain, who launched to the space station in December, has spent a total of 109 days in space and is scheduled to return to Earth in July. Hague arrived about a week ago on Pi Day (March 14) and will come home in October.