Two spacewalking astronauts — including Britain's first — successfully restored full power to the International Space Station on Friday after replacing a broken electronic box.

British spaceman Timothy Peake and NASA's Timothy Kopra removed the voltage regulator that  failed two months ago, slashing station power by one-eighth. The breakdown did not disrupt work at the laboratory orbiting 400 kilometres above Earth, but NASA wanted the power grid fixed as soon as possible in case something else failed.

Working in darkness to avoid electrical shock from the solar power system, the astronauts hurried to remove the bad unit and pop in a spare. They had just 31 minutes to complete the job, the amount of nighttime on that particular swing around the world.

Tim Kopra spacewalk

NASA astronaut Tim Kopra is seen outside the Quest airlock shortly after the beginning of this morning’s spacewalk. (NASA TV)

It took a bit longer than expected to install the spare, dubbed Dusty, about the size of a 30-gallon (113-litre) aquarium. The spare had been inside the space station since 1999; newly arrived cables allowed a software update.

Mission Control assured the spacewalkers they had enough time, as the two struggled to bolt down the spare unit. Once it was attached, power tests followed. Mission Control informed the astronauts everything looked good. "Awesome," replied Kopra.

Engineers suspect the original unit suffered an internal electrical short. Following the failure, the station relied on the seven other power channels.

The action unfolded on the far reaches of the space station. The work site is about 60 metres from the astronauts' exit, about as far as spacewalkers safely can go.

"Glad to see you both out there together on the tip of the world," Mission Control radioed.

Peake, in particular, received a bounty of well wishes — from space as well as Earth. He became the first spacewalker to wear the Union Jack on the shoulder of his suit.

"We're all watching, no pressure!" Former Beatle Paul McCartney said via Twitter. "Wishing you a happy stroll outdoors in the universe."

'A huge privilege'

Earlier, as Peake floated out, space station commander Scott Kelly called, "Hey Tim, it's really cool seeing that Union Jack go outside. It's explored all over the world. Now it's explored space."

Replied Peake: "It's great to be wearing it, a huge privilege, a proud moment."

Britain Astronaut Call

British astronaut Tim Peake gestures before the launch of the Soyuz TMA-19M space ship at the Russian-leased Baikonur cosmodrome in Kazakhstan. Tim Peake is set to become the first British astronaut to complete a spacewalk. (Dmitry Lovetsky/AP Photo)

Peake, a helicopter pilot chosen by the European Space Agency, is Britain's first official astronaut.

A handful of previous spacewalkers held dual U.S.-English citizenship, but flew as Americans for NASA. The first British citizen to fly in space, chemist Helen Sharman, visited Russia's old Mir space station as part of a private competition in 1991.

Peake and Kopra rocketed into orbit exactly one month ago aboard a Russian spacecraft.

To distinguish between the two Tims, Mission Control used both their first and last names when calling out to them. Ground controllers, at least, didn't have any problem distinguishing the spacewalkers' voices. Peake is from West Sussex in southeast England; Kopra is from Austin, Texas.

"Popping outside for a walk," Peake said in a tweet Thursday. "Exhilarated - but no time to dwell on emotions."