A new pacemaker has been built inside a heart by converting beating muscle into cells which can organise the organ's rhythm, US researchers report.
The heartbeat is controlled by electrical signals and if these go awry the consequences can be fatal.
Scientists injected a genetically-modified virus into guinea pigs to turn part of their heart into a new, working pacemaker.
The study was published in the journal Nature Biotechnology.
A human heart is made up of billions of cells, but researchers say fewer than 10,000 are responsible for controlling the heartbeat.
Age and disease can lead to problems such as the heart pumping too fast or too slow - and it can even stop completely, in what is known as a cardiac arrest.
The solution is an implanted battery-powered pacemaker which will jolt the heart to keep it in line.