A medical imaging technology under development has enabled doctors to see bacteria deep inside patients' lungs for the first time.
Early tests indicate the bedside technology may be able to detect harmful bacteria in patients' lungs in less than 60 seconds.
Fast diagnosis would enable critically ill patients to be given the right medicine quickly and could avoid unnecessary use of antibiotics.
The technology is being showcased at the Annual Congress of the American Association for the Advancement of Science in Austin, Texas, on 15-19 February.
Each year around 20 million patients in intensive care need ventilators to help them breathe. Up to one-third of these patients are suspected to have serious lung infections.
Doctors currently diagnose infections using X-rays, which are imprecise. Tests on fluid samples extracted from patients' lungs may also be used, but these can take days to return a result.
Researchers from the Universities of Edinburgh and Bath and Heriot-Watt University are developing a new approach with major funding from the UK's Engineering and Physical Sciences Research Council (EPSRC).
The consortium - called Proteus - is developing the imaging tool that can reach deeper into the lungs than existing devices.
The team have designed chemical probes that can be sprayed into patients lungs, which light up when they attach to specific types of infectious bacteria.
This fluorescence is detected using fibre-optic tubes that are small enough to travel deep inside patients' lungs.
The team is currently testing the chemical probes in clinical trials involving patients with a chronic condition called bronchiectasis.
Tests are also under way with intensive care patients who are being ventilated and are suspected of having pneumonia.
If the approach proves successful, doctors expect it will greatly speed up their ability to provide life-saving treatments for patients in intensive care.
At the moment, critically ill patients who are suspected to have an infection are often treated with powerful antibiotics as a precaution, before any infection is confirmed. These medicines can have side effects and are expensive.
This blanket approach to therapy can also contribute to the emergence of bacteria that are resistant to antibiotics, experts say.
The Proteus system aims to cut the use of antibiotics by pinpointing patients who will benefit and those who will not.
In addition to the chemical probes, the researchers are developing bespoke optical fibres and new detector technologies that will allow sensing as well as imaging deep inside the lung. This will enable doctors to measure biological changes in the lung, such as oxygen levels and acidity.
In parallel, the team are adapting the technology to detect and treat other types of infection and illness - such as fungi and cancer
Proteus has also received funding from the Medical Research Council, Wellcome and CARB-X, the world's largest public-private partnership devoted to antibacterial early development research.
Kev Dhaliwal, Professor of Molecular Imaging & Healthcare Technology at the University of Edinburgh, said: "Our team is making rapid progress in bringing together many technologies to help us develop entirely new approaches to diagnose and treat disease at the bedside.
Professor Philip Nelson, Chief Executive of the UK's Engineering and Physical Sciences Research Council (EPSRC) said, "The strength of the Proteus team is that it links the expertise and knowledge of people skilled in engineering, science and medicine. By investing in this research the research councils and their partners are making a real impact on the lives of patients both in the UK and elsewhere in the world. Collaboration is the key here and we look forward to seeing the techniques developed reaching the wider marketplace."