Tiny robots could be used to treat bleeds on the brain.
Scientists say that the technology could "open new frontiers in medicine" by injecting the bots into patients' bodies.
Lab tests carried out using model aneurysms and rabbits saw boffins engineer magnetic nanobots made up of blood-clotting drugs encased in a coating that is made to melt at a specific temperature.
Billions of the bots were injected into an artery where they clustered together and released the drug at the area where it could prevent and stem bleeding.
Dr. Qi Zhou, from the University of Edinburgh, said: "Nanorobots are set to open new frontiers in medicine, potentially allowing us to carry out surgical repairs with fewer risks and target drugs with pinpoint accuracy."
Research has also shown that the nanobots are capable of transporting drugs to precise locations without the risk of them leaking into the bloodstream.