Professor Stuart Russell, a leading artificial intelligence (AI) expert at the University of California, said allowing machines to kill humans would endanger freedom and security.
He remarked on the chilling vision following an appearance at the end of a short film which explores how AI could be used to take out targeted individuals.
The film, entitled Slaughterbots , shows a dystopian future where tiny drones are programmed to carry out mass killings.
It was shown at a United Nations summit that heard stark warnings about the growing danger of killer drone attacks.
Professor Russell states: "This short film is more than just speculation, it shows the results of integrating and miniaturising technologies that we already have.
"I've worked in AI for more than 35 years. Its potential to benefit humanity is enormous, even in defence.
"But allowing machines to choose to kill humans will be devastating to our security and freedom – thousands of my fellow researchers agree.
"We have an opportunity to prevent the future you just saw, but the window to act is closing fast."