These dogs are able to sniff out Parkinson's disease, and bladder and prostate cancer amongst other illnesses.
The Queen has been told how dogs are so far ahead of humans when it comes to detecting cancer, scientists are developing a digital dog’s nose.
If successful, she was told, it will save lives.
Dogs which sniff out cancers are trained by the charity Medical Detection Dogs.
And in the Royal Mews, the stables at the back of Buckingham Palace earlier, the Queen watched Kizzy – a cocker spaniel – discover which of the eight urine samples placed in front of her came from a human with bladder cancer.
It took Kizzy just half a second to dismiss the samples which were clear until she correctly indentify the one with cancer.
The dogs are being trained after the discovery some years ago that cancers do have a smell.
Kizzy went on to successfully detect a sample from a human with prostate cancer – a condition one in eight men will get.
Prostate cancer is harder to detect from a urine sample as it has not been in direct contact.
But this dog proved even that was possible.
The charity also showed how one of their dogs can detect the early signs of Parkinsons Disease, just from sniffing a swab of human sweat.
The Duchess of Cornwall, who is Patron of Medical Detection Dogs, sat alongside the Queen as the dogs did their work.
Camilla smiled, showing her pride in the charity she has worked with for many years.
At one point during the demonstration, one of the charity’s dogs barked at its owner to tell her that her blood sugar levels were too low.
The owner – who suffers from diabetes - left the room to take her test.
Another diabetes sufferer, Claire Pesterfield, told ITV News that her dog, Magic, "has saved my life" many times.
An American scientist is are now using one of the dogs to develop artificial intelligence technology which can mimic a dog’s nose.
Dogs are famously much better at smelling than humans because they have 300 million scent receptors compared to five million in humans.
Dr Andreas Mershin from Massachusetts Institute of Technology told us dogs can detect all sorts of diseases – each with its own smell – and they can do it much earlier than any machine can do.
One in two of us will be diagnosed with cancer at some point in our lives so there is a huge potential for this new technology based on a dog’s power of cognition and its extraordinarily sensitive nose.