In the tense final hours before Nasa's astronauts flew into space, a series of technical issues threatened to ground their landmark mission.


A faulty toilet and issues involving two safety systems were reported over the radio.


Nasa managed to resolve the problems by being quick on their feet, an official later said.


The Artemis II crew are now hurtling around the Earth's orbit, carrying out final tests and checks before they head towards the Moon.


Here’s what nearly went wrong - and what still could.


'Toilet is go'


The crew quickly discovered that even a trip to the Moon comes with very down-to-earth plumbing problems.


Sensors in the spacecraft's waste-management system threw up some readings they did not expect, according to flight controllers.


Astronaut Christina Koch reportedly acted as a plumber, dismantling parts of the toilet under instruction from mission control.


Happy to report that toilet is go for use, mission control later said over the radio. We do recommend letting the system get to operating speed before donating fluid.


Nasa has spent more than $23m (£17.4m) developing the Universal Waste Management System that accommodates both men and women.


Both men and women are able to use the system, which includes a funnel attached to a hose to process urine while using gentle airflow to eliminate spills.


The Orion - the spacecraft on which they're travelling - also has plenty of backup options, from alternative collection bags to different ways of routing liquids.


Issue with safety systems


There were also issues reported with the flight termination system and the launch abort system - two safety systems that protect astronauts and the public.


The flight termination system allows engineers on the ground to destroy the rocket if it veers off course. It reportedly had a communications issue, which was resolved by using hardware from the previous Space Shuttle programme.


The launch abort system is Orion's emergency escape tower, designed to pull the crew capsule away from the rocket in the event of an emergency during launch or ascent. It reportedly gave a higher-than-expected temperature reading, but it was judged that it wouldn't affect the launch.


With these issues resolved, the countdown clock was held at 10 minutes while engineers went through final preparations.


Artemis II, this is Launch Director – you are go for launch, the crew was told. We go for all humanity, Commander Reid Wiseman responded.


The rocket then launched into the sky, to the awe of those watching at the Kennedy Space Centre and around the world.