Electric fish, via evolution, acquired their jolting abilities by converting a simple muscle into an organ capable of generating a potent electrical field, scientists have discovered.

This electric organ evolved independently over six lineages in a wide variety of environments, ranging from the flooded forests of the Amazon to murky ocean waters.

"The surprising result of our study is that electric fish seem to use the same 'genetic toolbox' to build their electric organ," despite the fact that they evolved independently, Jason Gallant, an assistant professor of zoology at Michigan State University, added in a statement.

Hundreds of different species of electric fish exist in six broad lineages, and Darwin himself cited these fish as a prime example of convergent evolution - where unrelated animals independently evolve similar traits to adapt to different environments.

The electric organ is used to communicate with other fish, navigate and stun prey. The electric eel can deliver up to 600 volts - several times more powerful than the standard electrical outlet.

"A six-foot eel is a top predator in the water and is in essence a frog with a built-in five-and-a-half-foot cattle prod," explained study leader Michael Sussman of the University of Wisconsin-Madison.

"Since all of the visceral organs are near the face, the remaining 90 percent of the fish is almost all electric organ."

At least 100 million years ago these fish began realizing their untapped zapping potential when some started evolving electrolytes - a type of cell organized in sequence and capable of generating much higher voltages than those used to make muscles work. They acted like "batteries stacked in series in a flashlight," Sussman said.

By examining their lineages, the scientists found all species used the same genetic tools and cellular development pathways to become electrified.

"Our study demonstrates nature's creative powers and its parsimony, using the same genetic and developmental tools to invent an adaptive trait time and again in widely disparate environments," Sussman added.

The findings were published in the journal Science.