Updated at 8:30 a.m. with Cruz aide comment.

WASHINGTON — Under fire for his connections to a voter-targeting firm that used data taken from 50 million Facebook users without their knowledge, Texas Sen. Ted Cruz insisted Tuesday that he was unaware of any impropriety.

The Cruz presidential campaign touted its collaboration with Cambridge Analytica as a sign of a cutting edge run for the White House, allowing the Texan to carefully identify likely supporters. The firm shifted allegiance to Donald Trump once the Texan dropped out of the GOP primaries.

Both campaigns pumped millions into the company, controlled by billionaire Robert Mercer — a key patron first of Cruz and then Trump in 2016.

Cruz continued work with Cambridge Analytica for six months after allegations surfaced in December 2015 that the firm was using Facebook data it had received illicitly. Recent revelations show the data harvesting was far more extensive than previously suspected, and possibly among the biggest privacy breaches in history.

"They assured us the claims made in the press were false," Cruz spokeswoman Catherine Frazier said Tuesday.

She said the campaign's contract with the firm included explicit assurances "that all data used by them were obtained legally, that they would conduct their operations 'in accordance with all applicable laws and regulations,' and that they 'hold all necessary permits, licenses and consents to conduct its operations.' The campaign relied upon those representations."

And she said, Cambridge Analytica reiterated those assurances after the reports in late 2015. Critics of the firm, including whistleblower Christopher Wylie, a data scientist who worked for Cambridge Analytica, have long questioned the firm's methods.

"It was a grossly unethical experiment because you are playing with the psychology of an entire country ... in the context of the democratic process," Wylie told The Guardian. "It is a full service propaganda machine."

The firm's chief executive, Alexander Nix, called such allegations "entirely unfounded and extremely unfair," telling the BBC that he views the attacks as backlash stemming from its work with Trump.

Texas Democrats blasted Cruz on Monday for benefiting from a "massive invasion of privacy" and demanded that Cruz explain when he knew the company had engaged in "deceitful activity."

"Ted Cruz will stop at nothing to weasel his way into power, even if it means weaponizing stolen information to manipulate people to like him," Texas Democratic Party deputy executive director Manny Garcia said in a news release. "Cruz's campaign exploited personal information to create psychological profiles on millions of Americans. All to keep lining the pockets of Cruz's billionaire super PAC donors — like Robert Mercer, who funded this propaganda machine."

Frazier declined a request for comment Monday. On Tuesday, she said in a written statement: "The campaign hired Cambridge Analytica as a vendor to assist with data analysis and online advertising. The campaign's data analysis program followed and built upon the successful data-modeling and micro-targeting approach pioneered by the Obama campaigns in 2008 and 2012."

Cruz faces a Senate challenge in the fall from Rep. Beto O'Rourke, an El Paso Democrat. Federal campaign records show no sign of Cruz campaign ties with Cambridge Analytica since mid-2016.

Questions about the firm

A New York Times report published Saturday reopened questions about the firm and its methods, and the links between the Mercers, Trump and erstwhile Trump adviser Steve Bannon.

In July 2015, Rick Tyler, then a spokesman for Cruz, said the campaign used the data to identify potential voters by six personality types. He hailed the Cambridge data as "better than anything I've ever seen."

"This allows us to go into Iowa and match those traits with likely caucusgoers," he told Politico, referring to the February contest that Cruz ended up winning.

As questions ramped up about the Mercers' involvement with Cambridge in the following months, Tyler said he didn't "know all the details of ownership," according to an October 2015 interview with The Washington Post.

Facebook suspended Cambridge Analytica on Saturday. The personal data at issue was harvested by an academic researcher who then provided it to the firm in violation of Facebook's terms of service. Facebook says that in 2015, it learned that a University of Cambridge psychology professor, Dr. Aleksandr Kogan, had passed data from an app to Cambridge Analytica and its parent company, SCL.

About 270,000 people had downloaded an app Kogan had developed, "thisisyourdigitallife," which "offered a personality prediction, and billed itself on Facebook as "a research app used by psychologists." Unknown to those users, Kogan was also able to harvest data on their friend networks.

Cruz campaign

The Cruz campaign paid Cambridge Analytica $5.8 million between July 2015 and June 2016 for services that included "voter ID targeting," "voter modeling" and "survey research/donor modeling," according to the campaign's FEC reports.

The last payment was made a month after he suspended his campaign on May 3.

Cruz's leadership PAC, the Jobs Growth and Freedom Fund, paid the firm $133,000 more in October 2014, for a total of $5.94 million.

The Mercers pumped about $13.5 million into the pro-Cruz super PAC.

With Cruz out of the race, the Mercers shifted their support to Trump, and payments from his campaign to Cambridge Analytica began in July 2016 — $5.9 million for "data management" between then and December 2016.

The total is $7.4 million including payments from "Make America Number 1," a Super PAC funded mostly by Trump's largest donor, Mercer, and controlled by his daughter, Rebekah Mercer.

First questions

In December 2015 — six weeks before the first voting of the presidential cycle in the Iowa caucuses — The Guardian raised questions about Cambridge Analytica's methods, reporting that:

Ted Cruz's presidential campaign is using psychological data based on research spanning tens of millions of Facebook users, harvested largely without their permission, to boost his surging White House run and gain an edge over Donald Trump and other Republican rivals, the Guardian can reveal."

A little-known data company, now embedded within Cruz's campaign and indirectly financed by his primary billionaire benefactor, paid researchers at Cambridge University to gather detailed psychological profiles about the US electorate using a massive pool of mainly unwitting US Facebook users built with an online survey.

In that same story, Tyler denied anything unethical, telling The Guardian: "My understanding is all the information is acquired legally and ethically with the permission of the users when they sign up to Facebook."

Two days after that story was published, The Washington Post looked at Cruz's use of Cambridge Analytica and its tools.

Jeff Roe, Cruz's campaign manager, told The Post that the heavy reliance on data and analysis had rewritten the playbook for campaigns, making such tools as ads and polling less relevant.

"The conventional wisdom has been destroyed. What you can do is rely on data," Roe said.

He didn't respond to an interview request on Monday.

At the time, the Cruz campaign had spent just $750,000 with Cambridge Analytica, and the firm reportedly had staffers embedded at the Cruz campaign's headquarters in Houston.

As the Post reported: To develop its psychographic models, Cambridge surveyed more than 150,000 households across the country and scored individuals using five basic traits: openness, conscientiousness, extraversion, agreeableness and neuroticism. A top Cambridge official didn't respond to a request for comment, but Cruz campaign officials said the company developed its correlations in part by using data from Facebook that included subscribers' likes. That data helped make the Cambridge data particularly powerful, campaign officials said.

The Cruz campaign modified the Cambridge template, renaming some psychological categories and adding subcategories to the list, such as "stoic traditionalist" and "true believer." The campaign then did its own field surveys in battleground states to develop a more precise predictive model based on issues preferences.

The Cruz algorithm was then applied to what the campaign calls an "enhanced voter file," which can contain as many as 50,000 data points gathered from voting records, popular websites and consumer information such as magazine subscriptions, car ownership and preferences for food and clothing.

Ending the relationship

It's unclear when Cruz stopped working with Cambridge Analytica.

Some news accounts indicate that his campaign stopped using the firm's data after the South Carolina primary in late February 2016, though federal campaign records show more than $670,000 in payments to the firm for "media/voter modeling" or "voter ID targeting/web service" in March and June, plus $218,000 for "media" and "digital service/web service."

In March 2017 — long after Cruz ended his presidential bid — Tyler said Cambridge data had proven unreliable. The Times reported that "in one early test, more than half the Oklahoma voters whom Cambridge had identified as Cruz supporters actually favored other candidates."

It also is possible that the intense profiling of individual voters became less relevant or feasible once the contest expanded beyond the small states where retail-style campaigning is paramount — Iowa, New Hampshire and South Carolina.