An "intelligent" knife that knows when it is cutting through cancerous tissue is being tested in three hospitals.
Experts believe the wand-like device, the first of its kind in the world, will revolutionise cancer treatment by removing uncertainty from surgery.
In an early study, the "iKnife" identified malignant tissue in cancer patients undergoing operations with 100% accuracy.
After more extensive trials it could be approved for general use in operating theatres within three years.
Surgery is often the best hope of a cancer cure, yet even the best surgeons cannot be sure of removing every part of a tumour.
In the case of breast cancer, more than 20% of the cancerous tissue may be left behind.
This can result in a recurrence of disease, or patients having to undergo repeated operations.
The iKnife helps the surgeon by indicating exactly where the cancerous tissue is, and when it has all been removed.
It could allow surgeons to perform riskier operations, and also has the ability to reveal the original site of a cancer that has spread.
As well as potentially improving cancer survival, the device could save thousands of pounds per patient by cutting the cost of lab tests and follow-up operations.
The device is a hi-tech form of "electric scalpel", a tool routinely used by surgeons that uses electricity to sear through membranes and internal organs.
As the knife cuts, smoke from the burned tissue is pumped through a tube into a mass spectrometer, a machine that uses magnetism to produce a chemical "fingerprint" of the atoms fed into it.
The customised version being tested at St Mary's, Hammersmith and Charing Cross hospitals in London employs a user-friendly "traffic light" display.
Red indicates cancer and green healthy tissue, while yellows shows that a region is still unidentified.
More detailed information can also be obtained.
Using the iKnife, an operating surgeon can learn almost instantly if a suspicious growth is cancerous or benign.
Under normal circumstances, a tissue sample has to be sent away for analysis in the hospital's laboratories, which can still take up to half an hour.
The iKnife's inventor Dr Zoltan Takats, from Imperial College London, said: "The surgeon on the spot has to make a decision on where to cut and what to remove.
"The general solution is intra-operative histology.
"A tissue sample is removed from the patient and sent to the histology lab for analysis.
"But even in vast hospitals it can take 10 to 30 minutes.
"There are also reliability issues - the histology team are in an extreme rush and having to do things as fast as possible.
"We can give feed back to the surgeon in some cases in less than a second.
"This could be a real game-changer for tumour resection surgery."
Results of the preliminary study, involving 91 patients with a variety of cancers, are reported in the journal Science Translational Medicine.
To prepare the iKnife for the operating theatre, researchers first used it to probe tissue samples collected from 302 surgery patients and record the characteristics of thousands of cancerous and non-cancerous tissues.
This allowed the scientists to build up a reference library of molecular fingerprints, including those belonging to brain, lung, breast, stomach, colon and liver tumours.
During surgery, readings from the iKnife are compared with the library data to determine what kind of tissue is being cut.
In every case, the device was able to spot malignant tissue later identified by post-operative laboratory analysis.
A randomised trial is now planned comparing outcomes from surgery conducted with and without the iKnife in hundreds of patients.
At a demonstration of the device for journalists at St Mary's Hospital, the iKnife was used to slice through lumps of pork meat, generating sparks and and noxious smoke.
Dr Takats, who came up with the idea of the iKnife while working at Semnelweiss University in Hungary, said the device could allow surgeons to carry out operations that might normally be considered too risky.
"In principle, this approach could push the line of what is operable a little bit further down the road," he said.
"Such cases that today are just opened and closed back up may now fall into the operable category.
"Often the problem is if there is an invasive but still localised tumour, no-one has the courage to really go after it."
Another advantage of the iKnife is its ability to trace a tumour's origins - something that is not always easy to do with a spreading cancer.
Professor Jeremy Nicholson, head of the department of surgery and cancer at Imperial College London, a leading member of the study team, said: "The memory of where it comes from is captured in the smoke - I find that quite romantic."
Co-author Lord Darzi, Professor of Surgery at Imperial College, said: "In cancer surgery, you want to take out as little healthy tissue as possible, but you have to ensure that you remove all of the cancer.
"There is a real need for technology that can help the surgeon determine which tissue to cut out and which to leave in.
"This study shows that the iKnife has the potential to do this, and the impact on cancer surgery could be enormous."
A company called Medimass has been set up to develop the device commercially.
Dr Takats, one of its founders, said the team was looking for a partnership deal with a "big industrial player".
Modified versions of the iKnife could have a number of other non-medical applications, including food testing.
"We've already shown that it can distinguish between horse meat and beef, and it works on cooked as well as raw meat," Dr Takats said.