Media playback is unsupported on your device Media caption Watch the moment Tim Peake's spacewalk is called off early

Nasa has ended the spacewalk involving UK astronaut Tim Peake after his US colleague reported water in his helmet.

Tim Kopra reported a "small amount" of water, but the flight director took the precaution of ending the event early.

The agency is under a ruling to terminate a spacewalk under such circumstances after an incident in 2013, when a European astronaut developed a significant helmet leak.

The astronauts were outside the space station for four hours 43 minutes.

The main objective of the spacewalk - replacing a failed electrical box - had already been completed.

Just before 1700 GMT, Colonel Kopra, a Nasa astronaut who is a veteran of two spacewalks, told mission controllers a water globule measuring a few inches across had developed inside the helmet.

As it happened: Tim Peake's spacewalk

He was able to sample the water and found it was cold, which is indicative of a leak from part of the US-built suit's cooling system.

Image copyright Tim Peake Image caption Tim Peake posted a selfie on Twitter that he took during the spacewalk

Image copyright NASA Image caption Nasa chief astronaut Chris Cassidy (in the blue shirt), who assisted Luca Parmitano in 2013, is seen conferring with colleague Reid Wiseman

On 16 July 2013, Luca Parmitano was involved in a life-threatening situation when a large amount of water leaked out during a spacewalk - obscuring his vision.

The Italian national had to be helped back to the ISS airlock by his colleague, US astronaut Chris Cassidy.

Cassidy said astronauts had absorbent pads on the insides of their helmets. Pushing their heads back and feeling "squishiness" was a sign of leakage.

But he said the key signature of potential hazard was the water's temperature.

"As soon as you can feel it's cold, you know it's something coming from a source in the backpack and that's of significant concern," he told Nasa TV.

The suit used by Col Kopra on Friday's spacewalk is apparently the same one worn by Major Parmitano in 2013. It was given an overhaul after the incident involving the European Space Agency astronaut.

More conservative flight rules were put in place after the incident with Major Parmitano, prompting flight director Royce Renfrew to call a halt to the spacewalk at 16:58 GMT.

Media playback is unsupported on your device Media caption Watch highlights of the first spacewalk task, repairing a power unit

"When we found water on the visor, that was when we pulled the trigger and terminated the walk," Mr Renfrew explained.

After receiving the instruction, the astronauts immediately started making their way back to the Quest airlock - arriving there about 15 minutes later.

After the duo were safely inside with the outer airlock hatch closed, Tim Peake thanked mission controllers: "You guys did a great job," he said.

He later posted pictures taken during the spacewalk including a selfie, along with the caption "Today's exhilarating #spacewalk will be etched in my memory forever - quite an incredible feeling!"

Image copyright NASA Image caption Earlier on the spacewalk, astronauts replaced a failed electrical box with time to spare

The ISS's other crew members, Nasa astronaut and station commander Scott Kelly, along with Russian Space Agency (Roscosmos) cosmonauts Sergey Volkov and Yuri Malenchenko, were on hand to assist the pair.

Once the inner hatch was opened, they first helped Kopra remove his helmet.

Scott Kelly used a syringe to collect a 15ml sample of the water (about three teaspoons) and remove absorption pads from the inside of the helmet as evidence for investigators who will aim to determine the cause of the leak. They also took extensive photographs of Kopra and of the suit.

Scott Kelly told ground controllers that Mr Kopra was wet around the shoulders, and the wrist area, with moisture also found on the cooling garment worn under the spacesuit and in the ventilation tubes.

Tim Peake had a small amount of moisture around the wrists, said Mr Kelly, but was otherwise unaffected.

Earlier in the spacewalk, Col Kopra reported abnormal carbon dioxide readings from his suit. But ground controllers decided it was down to a sensor problem.

Follow Paul on Twitter.