(Bloomberg) -- Palantir Technologies Inc., the data analysis firm co-founded by tech billionaire Peter Thiel and contracted by government intelligence agencies and military forces around the world, has emerged as the top pick for a contract to overhaul the UK’s National Health Service.

The five-year contract, which may be extended by as long as two years and is worth much as £480 million ($579 million), is designed to help the agency analyze medical data, detect patterns and ultimately overhaul its entire system. The deal is subject to final approvals and legal arrangements, but the government was on track to announce Palantir as the winning bidder as soon as this month, people familiar with the discussions said, asking not to be identified because the information isn’t public.   

Palantir shares rose about 1.4% in premarket trading on Wednesday following the news. 

Read More: Palantir Had Plan to Crack UK Health System: ‘Buying Our Way In’

The arrangement is both somewhat predictable and extremely controversial. Palantir has been working with the UK government since the Covid-19 pandemic, helping manage the country’s vaccine rollout for a £1 fee that positioned it well for more lucrative deals. Its relationship with the NHS has drawn fire from civil rights and patient advocacy groups that are concerned about the privacy of patient data.  

Palantir and the National Health Service didn’t respond to requests for comment. In an Aug. 25 blog post, NHS’s chief data officer said a software vendor would “never hold or have access to NHS data for any purpose other than as directed by” the agency and indicated that patients would have a say in how their information is used.

Named after the all-seeing stones in J.R.R. Tolkien’s The Lord of the Rings, Palantir got its start working for the US Central Intelligence Agency and the Pentagon, helping analysts interpret intelligence from the battlefield in Afghanistan and Iraq for signs of suspicious behavior or impending terrorist attacks. The FBI and police have used the software in criminal probes and it’s been deployed by banks, helping managers watch for suspicious behavior from employees. 

Controversies around Palantir’s work with the NHS have mainly concerned transparency about what data the NHS is handing over, how it’s being used and whether patients can opt out.

In 2020, a leaked copy of a contract showed that the Denver-based tech company had been allowed access to sensitive data about patients, employees and members of the public in an attempt to help the health service cope with the coronavirus outbreak. Those details included political and religious affiliation and past criminal offenses, according to a copy of the documents published by politics website OpenDemocracy and the group Foxglove at the time. 

Read More: Palantir Given Access to UK Health Data on NHS Patients 

Two years later, the Doctors’ Association UK, National Pensioners’ Convention and Just Treatment sent a letter to NHS England demanding information about a pilot project that would use Palantir’s Foundry software platform and how client data would be safeguarded. 

Thiel, who is still Palantir’s chairman, has described the UK’s affection for the NHS as “Stockholm syndrome,” and recommended that the country could “rip the whole thing from the ground and start over,” in a speech at the Oxford Union in January. Palantir said at the time that Thiel was speaking in a private capacity and that his views didn’t reflect the views of the company.

The NHS is the UK’s national health service, the publicly funded operation providing medical care that’s free at the point of access for the 67 million people living in England, Scotland, Wales and Northern Ireland. Still, it’s been beset by staff shortages and backlogs after the pandemic delayed less-urgent procedures. 

The impact on England’s public healthcare system may be larger than the impact on Palantir’s bottom line. The firm generated more than $1.07 billion in government revenue in 2022 and is on track for $1.26 billion this year. The UK contract, while lucrative, is spread over the course of several years. So while it may not have a major effect on Palantir’s immediate results, it could serve as beachhead for future sales.

--With assistance from Lizette Chapman.

(Updates with premarket shares in the third paragraph.)

©2023 Bloomberg L.P.