The Pentagon is spending $161 billion on a program to build heavily-armed robots for the battlefield in the hope that future wars will be fought without the loss of its soldiers' lives.
The scheme, known as Future Combat Systems, is the largest military contract in American history and will help to drive the defence budget up by almost 20 per cent in five years' time.
Much of the cash will be spent computerising the military, but the ultimate aim is to take members of the armed forces out of harm's way. They would be replaced by robots capable of hunting and killing America's enemies.
Gordon Johnson, of the US joint forces research centre, told the New York Times: "The American military will have these kinds of robots. It's not a question of 'if', it's a question of 'when'."
The American military is already planning units of about 2,000 men and 150 robots, among them land-based "infantry" devices and drone aircraft.
In the far future it is hoped that the minaturised robots will walk like humans, or hover like some birds. Others may look like insects.
Scientists say that, working at full tilt, the process is likely to take at least 20 years.
Robert Finkelstein, the head of one development firm called Robotic Technologies, said the Pentagon has established the goal "but the path is not totally clear".
In the meantime, the military is developing simpler technologies.
The US military has already bought a tracked robot which can enter highly risky sites such as cave complexes favoured by al-Qa'eda. The machines have been deployed in the cave complexes of Afghanistan, digging up roadside bombs in Iraq and guarding weapons storage sites.
The Swords robots come in several versions, carrying either a machine gun, grenade launcher or a light anti-tank weapon. It is controlled by a soldier from a distance of up to 1,000 metres.
"We were sitting there firing single rounds and smacking bull's-eyes," said Staff Sergeant Santiago Tordillos, who helped to design and test the robot. "We were completely amazed."
That human involvement has proved critical in convincing military lawyers that machines can be used on the battlefield. More advanced machines which can decide whether to kill would also be legal, says Mr Johnson.
"The lawyers tell me there are no prohibitions against robots making life-or-death decisions," he said.
The program is already causing other nations to reassess their military priorities. Britain's armed forces in particular will need to follow the American lead if only because the two militaries fight together so often.
While the cost of the scheme is huge, it may ultimately save large sums of money. Professional soldiers, their dependents and pensions are pricey. Once robotic technology is developed, the Americans say, the cost of a robot soldier might be only 10 per cent that of its human counterpart.
A US navy research centre in San Diego has already produced a robot built to look like a human. At 1.3 metres, it has a gun on its right arm and a single eye and could shoot at a target.
One researcher, Jeff Grossman, said the intelligence of the machines was increasing. "Now, maybe, we're a mammal. We're trying to get to the level of a primate."
When researchers succeed, a number of troubling moral dilemmas will have to be addressed. Some in the American computer business are asking whether it is acceptable to have machines decide for themselves whether to take human life and what will happen when - inevitably - the robot makes a mistake.
Bill Joy, who helped to found Sun Microsystems, said 21st century machines could become "so powerful that they can spawn whole new classes of accidents and abuses".