Nigel Farage supports Donald Trump during the presidential campaign, on August 24, 2016 | Jonathan Bachman/Getty Images US billionaire who helped Trump campaign also helped Leave.eu Breitbart co-owner Robert Mercer is a long-time friend of Nigel Farage.

A U.S. billionaire who co-owns right-wing Breitbart News and helped bankroll Donald Trump’s presidential campaign, also played a key role in the Brexit campaign, according to the Observer.

Robert Mercer is a long-time friend of former UKIP leader Nigel Farage, the paper said. During the referendum campaign, he offered the Leave campaign free services from his business Cambridge Analytica, to sway swing voters on social media through targeted ads.

Cambridge Analytica, an offshoot of British company SCL Group, claims to offer “cutting-edge data enhancement and audience segmentation techniques” to profile and target audiences, such as voters.

The Trump campaign paid the firm more than $6 million for the company’s services. The Leave campaign did not file a donation from the company; all gifts over £7,500 must be declared by law to the electoral commission.

Leave.eu filed documents saying the company was a “strategic partner,” but in December, when questioned by the paper, said that it was untrue the company had worked on the Leave campaign. The firm declined to comment a second time on whether it had donated services.

Cambridge Analytica was “happy to help … because Nigel is a good friend of the Mercers,” communications director of Leave.eu, Andy Wigmore, told the Observer.

He said Mercer suggested the company “may be useful” to the campaign.

“What they were trying to do in the U.S. and what we were trying to do had massive parallels. We shared a lot of information,” he added.

Two weeks ago, Leave.eu founder Arron Banks said in a series of tweets that the campaign’s pollster Gerry Gunster and Cambridge Analytica with “world class” artificial intelligence had helped them gain “unprecedented levels of engagement”. “AI won it for Leave,” he said.