The rise of “self-aware” robots has come a major step closer following the invention of a machine capable of thinking for itself from scratch, scientists have said.

Engineers at Columbia University claim to have smashed one of the biggest barriers in the field of robotics after a mechanical arm, which had not been programmed with any instructions, began performing practical tasks after just a few hours.

The team said this is the first time a robot has shown the ability to “imagine itself”, thereby working out what its purpose is and how to perform it.

Until now, some experts had pointed to the failure to achieve this as evidence that machines would never be able to develop their own intelligence in the complex way that humans do.

The robotic arm was programmed with no knowledge of physics, geometry or motor dynamics.

It spent approximately 35 hours moving about at random, however intensive machine-learning computing was going on during this time.

Eventually, the robot was able to understand its own dimensions and capabilities.

It then began successfully performing exercises, picking up objects and placing them elsewhere.

Professor Hod Lipson, who leads the Creative Machines lab, where the research was carried out, said: “This is perhaps what a newborn child does in its crib, as it learns what it is," he says.

"We conjecture that this advantage may have also been the evolutionary origin of self-awareness in humans.

“While our robot's ability to imagine itself is still crude compared to humans, we believe that this ability is on the path to machine self-awareness."

The self-modeling robot was also used for other tasks, such as writing text using a marker.

Meanwhile to test whether the self-model could detect damage to itself, the researchers 3D-printed a deformed part to simulate damage and the robot was able to detect the change and re-train its self-model.

The new self-model enabled the robot to resume its pick-and-place tasks with little loss of performance.

"Self-awareness will lead to more resilient and adaptive systems, but also implies some loss of control," the authors warn.

"It's a powerful technology, but it should be handled with care.” The study is published in the journal Science Robotics.