Health boards across Scotland have been ordered to carry out urgent tests on hospital water supplies after widespread contamination at two Glasgow hospitals.

The investigation by NHS Greater Glasgow and Clyde (GGC), which is already dealing with a spate of other infection-related deaths and crises, revealed 23 cases of blood stream infection were detected at two recently built hospitals last year.

The infections at the flagship Queen Elizabeth hospital and adjoining Royal hospital for children, in the first nine months of last year, were all “potentially linked to water contamination” by 11 different organisms, it was found.

The instruction from Health Protection Scotland (HPS), a government agency, came as it emerged two premature babies died in a third hospital in the city in January after being infected by a very rare antiobiotic-resistant bacteria.

The babies were infected in a neonatal unit at Princess Royal maternity hospital by a strain of the staphylococcus aureus bacterium, type 11164, never before seen in the UK and only previously detected twice worldwide.

It is highly resistant to the two most commonly used antibiotics, and the standard skin cleaning solution used by the NHS. The babies’ deaths, and the infection of a third premature baby, came to light in January but the rare strain was only named this week.

NHS Greater Glasgow and Clyde said no further cases had been detected since but opposition parties said the disclosure raised fresh questions about infection control in the board’s hospitals.

The HPS report was written after a spate of unusual infections at other GGC hospitals that have come to light over the last three months.

In late January prosecutors disclosed they were investigating the deaths of two patients, a 10-year-old boy and a 73-year-old woman, who contracted an infection linked to pigeon droppings at Queen Elizabeth hospital.

Two patients at that hospital also became seriously ill after contracting a separate fungal infection called mucor, while a patient at Royal Alexandra hospital in Paisley died from a separate hospital-acquired infection in December.

In light of the water contamination disclosures, HPS said it was essential every Scottish health board test the water at any hospitals built since 2013. The Scottish government launched a substantial hospital building strategy partly using public funds, in the case of the Queen Elizabeth, but also private financing.

Jeane Freeman, the Scottish health secretary, said the HPS report would feed into a wider inquiry into the Queen Elizabeth hospital ordered after the deaths came to light. “As I have previously stated to parliament, it is vital that we all understand what the issues are, why they have arisen, and that the recommendations will be taken forward,” Freeman said.

Monica Lennon, Scottish Labour’s health spokeswoman, criticised Freeman for releasing the report on a Friday, when Holyrood was not sitting. “Given the circumstances, the health board and the government should be inviting as much scrutiny and acting in as transparent a manner as possible,” she said.

“Jeane Freeman and First Minister Nicola Sturgeon both insisted last month that there was no infection control problem at the hospital – but 23 cases of blood stream infections in less than nine months tells a different story.”