LONDON - Britain's government acted unlawfully when it gave a contract to a public relations firm run by associates of Prime Minister Boris Johnson's former chief adviser, Dominic Cummings, a London court ruled on Wednesday.

The court said the government had shown "apparent bias" in awarding more than 560,000 pounds ($794,000) to Public First to test public opinion on the government's response to the coronavirus pandemic.

The Good Law Project, a campaign group, brought a judicial review against the government, saying the contract was awarded without any competitive tenders in the early stages of the pandemic.

Finola O'Farrell, a High Court judge, said the government was entitled to award the contract because the work was needed.

But she said the failure to consider any research firms "would lead a fair-minded and informed observer to conclude that there was a real possibility, or a real danger, that the decision-maker was biased".

The government argued that there was no time to run a normal competitive selection process.

Cummings said he had been more concerned with trying to save lives than ensuring all decisions taken during the first wave of the pandemic were lawful in the eyes of the court.

"On this basis the courts shd rule that many 2020 decisions were similarly ‘unlawful’ as I & the Cabinet Secretary repeatedly told officials ‘focus on imminent threats to lives/destruction, not process/lawyers/Potemkin paper trails," he said in a tweet.

The National Audit Office said last year there had been a lack of transparency and a failure to explain why certain suppliers were chosen, or how any conflict of interest was dealt with, in procurement deals between March and the end of July worth about 18 billion pounds ($25.5 billion).

Opposition politicians have accused the government of running a "chumocracy" with contracts, including for the purchase of what turned out to be unusable personal protective equipment, and appointments made to those with family or business links to those in power.

After Tuesday's ruling, Jolyon Maugham, founder of the Good Law Project, said the government should look into proposals to improve procurement and stop wasting taxpayers' money.

The ruling is more of a symbolic victory because the judge did not make the decision on the basis of actual bias, which could be a criminal offence.

Public First is run by James Frayne and Rachel Wolf, both of whom previously worked with Cummings and the Cabinet Office minister, Michael Gove. Cummings quit as Johnson's chief adviser late last year. Gove remains in office.

Angela Rayner, the deputy leader of the opposition Labour Party, wrote to the prime minister to call for an investigation into whether Gove broke the ministerial code.

The Cabinet Office said in a statement that the issues raised in court had been addressed and there was "no suggestion of actual bias".

A spokesperson for Public First said it was proud of the work it did in the early stages of the pandemic and the judge found that weak internal processes gave rise to the appearance of bias.

"The judge made no criticism whatsoever of Public First anywhere in the judgement," he said. ($1 = 0.7059 pounds)

(Reporting by Andrew MacAskill and William Schomberg, Editing by Estelle Shirbon, Alistair Smout, Timothy Heritage and Nick Macfie) ((william.schomberg@thomsonreuters.com; +44 207 542 7778; Reuters Messaging: william.schomberg.reuters.com@reuters.net))