(Bloomberg) -- The UK government said it will comply with a court order to disclose all of former Prime Minister Boris Johnson’s WhatsApp messages with his staff during the pandemic to the official Covid-19 inquiry.

Rishi Sunak’s government had tried to prevent the inquiry from having access to the communications on privacy grounds. But High Court judges on Thursday rejected the government’s challenge, meaning in effect that ministers cannot filter the messages they submit to the pandemic probe.

It will be for the inquiry’s chair, a retired judge, to decide whether documents are relevant to the investigation, the court said. 

The ruling is a major blow to Sunak, who wants to move beyond the simmering public resentment over the UK’s handling of the coronavirus outbreak. As Chancellor of the Exchequer, Sunak was one of the most senior members of Johnson’s government during the period, and organized an “Eat Out to Help Out” plan which, according to research, worsened the pandemic. 

Even so, the inquiry’s request is complicated by the fact Johnson has said his communications until May 2021 are on an old phone that is switched off on security grounds. The first pandemic lockdown was in March 2020. Government officials are working on retrieving the information.

Lawyers for the government had asked the court to limit the panel’s authority to demand disclosure of ministerial conversations and said it shouldn’t be allowed access to messages that would be irrelevant to the inquiry or might contain private or sensitive conversations. 

Read More: Why the UK Wants a Legal Fight With Covid Inquiry It Appointed: Q&A

The government brought the case with “some reluctance” and has already provided a mass of documents to the inquiry, it said at a hearing last week. The inquiry countered that Sunak’s administration is “significantly” undermining the investigation by refusing to hand over the messages. 

The decision can be appealed but, Sunak’s spokesman Max Blain told reporters at a regular briefing the government plans to comply with the ruling.

Johnson, also a party to the case, had supported the inquiry’s case, saying the government’s steps during the pandemic must be minutely scrutinized but he sought arrangements to keep the information confidential.

The court rejected the government’s arguments that the inquiry’s demand was irrational and beyond its powers.

“This judicial review was a desperate waste of time and money,” said Deborah Doyle, a spokesperson for the campaign group Covid-19 Bereaved Families for Justice UK. Any further attempt to hinder the inquiry’s work “would be utterly shameful,” she said in a statement after the ruling.

--With assistance from Emily Ashton and Joe Mayes.

©2023 Bloomberg L.P.