WASHINGTON - The first animal to crawl onto land from the ocean probably looked a bit like today's salamander, and researchers have wondered how it was able to switch from swimming to walking.

Now, European scientists have built a robot with a primitive electric nervous system that they say mimics that change in motion.

The robot doesn't look much like a salamander -- it's nearly a yard long and made of nine bright yellow plastic segments each containing a battery and microcontroller -- but it does seem to move like one.

The point was to understand how a spinal cord developed to direct a swimming motion that could handle the different coordination needed between a body and its limbs for walking, according to the team led by Auke Jan Ijspeert of the Ecole Polytechnique Federale in Lausanne, Switzerland.

So they first designed a basic nervous system modeled on that of the lamprey, a long, primitive eel-like fish. Then that design was modified to show how it could evolve into a nervous system that also could control walking.

And to prove their point, they built the salamander robot -- which walks across floors, down the beach and even manages to swim in Lake Geneva.

Its swimming motion uses undulations like the lamprey, while on land the robot uses a slow stepping gait with diagonally opposed limbs moving together while the body forms an S-shape.

The work, the researchers reported Friday in the journal Science, is "a demonstration of how robots can be used to test biological models, and in return, how biology can help in designing robot locomotion controllers."

The research was funded by the Swiss National Science Foundation and the French Ministry for Research and Technology.