It has been the dream - and nightmare - of science fiction writers for decades. Now a team of engineers has conjured up a robot that can reproduce itself.
The robot can self-replicate in much the same way that some living organisms are able to reproduce by cloning themselves.
Although the machine in question serves no useful purpose other than to make copies of itself, scientists believe it has set a precedent for a future in which robots will proliferate on their own.
In the long term, the scientists envisage a day when armies of self-replicating robots will be able mend themselves when broken, expand their population, explore space and even establish self-sustaining colonies on other planets.
Hod Lipson, a mechanical engineer at Cornell University in Ithaca, New York, who led the research team, is one of a number of robot specialists who believes that machines will one day design and build themselves as a form of "artificial life".
"Self reproduction is central to biological life for long-term sustainability and evolutionary adaptation, " Professor Lipson writes with his colleagues in the journal Nature.
"Although these traits would also be desirable in many engineered systems, the principles of self reproduction have not been exploited by machine design.
"Here we create simple machines that act as autonomous modular robots and are capable to physical self-reproduction using a set of cubes."
Modular cubes called "molecubes", each of which contains the machinery and computer program necessary for replication, are at the heart of the robot's ability to self-replicate.
Electromagnets on each of the cubes' facesallow them to attach and detach themselves to another cube according to the computer's instructions.
This allows a damaged robot to jettison defective cubes and replace them by working ones or for it to construct a separate robot from scratch by building a stack of individual cubes.
When the newly-formed robot reaches a certain height it helps to finish off its own replication by adding the last molecubes to its own body.
Professor Lipson said that although the robot they have designed would only work in a laboratory, it would - in theory - be possible to adapt the design to enable self- replication to take place in space or other hazardous environments.
"Self-reproduction is an extreme case of self-repair from an engineering point of view," Professor Lipson said. "Ultimately we hope that we can build machines that can self-repair, especially in a hazardous environment when we need machines to work for an extended period without human maintenance.
"Although the machines we have created are still simple compared with biological systems, they demonstrate that mechanical self-reproduction is not unique to biology. This design concept could be useful for long-term, self-sustaining robotic systems in emerging areas such as space exploration and operation in hazardous environments, where conventional approaches to maintenance are impractical."
The researchers were able to demonstrate a robot made from four modules that could build a replica of itself in two and a half minutes by lifting and assembling the cubes from a "feeding point" on the ground.