Nasa has successfully crashed a spaceship into an asteroid in the first ever "planetary defence test," clearing the way to perhaps one day save humanity from extinction.
The mission was the first attempt to alter the movement of a celestial body. It was intended to prove that it is possible to change the course of any future doomsday space rock threatening to obliterate Earth.
The historic test, which has been compared to the plot of the Hollywood movie "Armageddon," involved sending a $325 million spacecraft called DART [Double Asteroid Redirection Test] on a 10-month kamikaze journey.
In the early hours of Tuesday morning British time DART, which was about the size of a large fridge and moving at 14,000mph, ploughed into an asteroid called Dimorphos, which is about the size of a football stadium.
At mission control in Maryland engineers high-fived and an announcer declared: "We have impact in the name of planetary defence."
Lori Glaze, Nasa's planetary science division director, said: "We are embarking on a new era of humankind."
In the seconds before impact, incredibly clear images of the asteroid were beamed back, at one second intervals, by a camera on the spaceship called DRACO.
They showed the rugged surface of Dimorphos strewn with boulders. The surface then filled the screen and the radio signal abruptly ended, as expected, due to the impact. It was a cosmic collision that happened seven million miles from Earth.
Scientists believe the impact will have caused a crater and hurled streams of rocks and dirt into space. Telescopes around the world, and in space, are now being trained on Dimorphos to assess the aftermath.
It will be days, possibly weeks, before it can be established how much the asteroid's path was changed by the collision.
Nasa hopes it will be altered by about one per cent, a celestial nudge which will show it is possible to alter a large object's trajectory in this way.
In the film Armageddon a team of oil drillers, led by Bruce Willis, are sent to an approaching asteroid to dig a hole and drop a nuclear bomb in it, splitting the giant rock apart.
Nasa does not believe that would be a good strategy for saving Earth, because it could create many pieces that might hit the planet.
Before DART reached its destination Nasa Administrator Bill Nelson said: "No, this is not a movie plot. We've all seen it on movies like 'Armageddon,' but the real-life stakes are high."
In the lead up to the collision Nasa had described it as "a very complicated game of cosmic billiards".
Dimorphos orbits around another asteroid called Didymos, which is five times bigger, about every 12 hours. The pair of asteroids are no threat to Earth but were used as a test because they are close enough to be seen by telescopes.
DART used a "smart navigation system" developed by Johns Hopkins University's Applied Physics Laboratory to lock on to Dimorphos and direct itself there.
About 7,000 miles out Didymos, the larger asteroid could be seen in the images from DRACO as a white dot in the vast blackness of space.
Several minutes later Didymos loomed on the screen, and then disappeared to the left as DART passed by and headed for Dimorphos.
Johns Hopkins mission systems engineer Elena Adams. said: "Woohoo, we're seeing Dimorphos, so wonderful, wonderful."
Following the impact she said: "We knew we were going to hit. All of us were holding our breath. I’m kind of surprised none of us passed out.
"It was basically a bullseye. I think, as far as we can tell, the first planetary defence test was a success."
Two weeks ago DART released a mini-satellite provided by the Italian Space Agency, to record the impact and send images back to Earth. Those were expected to show a bright flash and then a plume of dust.
Nasa hopes the test will ultimately allow humanity to avoid a mass extinction event like the one believed to have wiped out the dinosaurs, and most life on Earth, 66 million years ago.
Already, at least 26,000 "near-Earth objects" have been identified, with many more still to be found. There are estimated to be 4,700 such space rocks which meet Nasa's classification as "Potentially Hazardous Objects".
That means they are larger than 500ft across, pass within 4.7 million miles of Earth, and would cause devastation if they hit.