A group of leading technology and scientific leaders, including physicist Stephen Hawking and Apple co-founder Steve Wozniak, have issued a stern warning against the development of so-called killer robots.
Autonomous weapons, which use artificial intelligence to select targets without human intervention, have been described as "the third revolution in warfare, after gunpowder and nuclear arms", about 1,000 scientists, academics and entrepreneurs wrote in an open letter.
"The key question for humanity today is whether to start a global AI [artificial intelligence] arms race or to prevent it from starting," they wrote on Tuesday.
"If any major military power pushes ahead with AI weapon development, a global arms race is virtually inevitable."
The idea of an automated killing machine - made famous by films such as The Terminator - is moving swiftly from science fiction to reality, according to the scientists.
"The deployment of such systems is - practically if not legally - feasible within years, not decades," the letter said.
The scientists painted the doomsday scenario of autonomous weapons falling into the hands of terrorists, dictators or warlords hoping to carry out ethnic cleansing.
'Beyond meaningful human control'
The group concluded with an appeal for a "ban on offensive autonomous weapons beyond meaningful human control".
However, they also noted the potential benefits of autonomous weapons in the letter, saying: "There are many ways in which AI can make battlefields safer for humans, especially civilians, without creating new tools for killing people."
They could also reduce the extent of battlefield casualties and might also lower the threshold for going to battle, the scientists said.
The letter was presented at the opening of the 2015 International Joint Conference on Artificial Intelligence in Buenos Aires.
Related: Reigning in fully autonomous 'killer robots'
Elon Musk, the billionaire co-founder of PayPal and head of SpaceX, a private space-travel technology venture, also urged the public to join the campaign.
"If you're against a military AI arms race, please sign this open letter," Musk tweeted.
Authorities are gradually waking up to the risk of robot wars. Last May, for the first time, governments began talks on so-called "lethal autonomous weapons systems".
In 2012, Washington imposed a 10-year human control requirement on automated weapons, welcomed by campaigners even though they said it should go further.
There have been examples of weapons being stopped in their infancy. After UN-backed talks, blinding laser weapons were banned in 1998, before they ever hit the battlefield.