Several high-profile data and tech companies have made millions of dollars from contracts with the U.S. Immigration and Customs Enforcement agency over the past several months — even as some of them have publicly disavowed the Trump administration’s recent orders to separate immigrant children from their parents at the border.

Hewlett Packard Enterprise, Thomson Reuters, Microsoft, Motorola Solutions and Palantir all have active contracts with the agency, known as ICE, according to a public records search conducted by NBC News.

The contracts highlight how technology companies, many of which have developed advanced data analysis and tracking abilities, are putting their innovations to work with the U.S. government in ways that are often not visible to the public.

Attorney General Jeff Sessions issued a “zero tolerance policy” on April 6 and in a speech on May 7 said, “If you are smuggling a child, then we will prosecute you and that child will be separated from you as required by law.”

President Donald Trump signed an executive order on Wednesday ending the separation practice, after insisting for days that Democrats had created the policy and he could not personally end it.

ICE has taken a more aggressive stance against undocumented immigrants as a result of the administration’s vow to crack down on illegal immigration. Even before the administration’s zero-tolerance policy took effect, deportations of noncriminals rose 17 percent in Trump’s first year in office.

Palantir, whose chairman, Peter Thiel, is one of nine members on the board of Facebook, took in more than $4.9 million from ICE on May 30, part of a $39 million contract that began in 2015. According to a government database search, the contract goes toward “operations and maintenance” of Falcon, Palantir’s proprietary intelligence database that tracks immigrants’ records and relationships.

Palantir, a data firm that tends to stay out of the press, is now used by law enforcement agencies across the country. Some of its programs have come under scrutiny, including the use of data to predict the likelihood of whether a person will commit or become a victim of violence.

Venture capitalist Peter Thiel, in Washington last June. Chip Somodevilla / Getty Images

Executives at Facebook have been vocal in criticizing the Trump administration’s family separation policy.

“We need to stop this policy right now,” Facebook CEO Mark Zuckerberg wrote on Tuesday. Zuckerberg and fellow Facebook board member Sheryl Sandberg pledged to donate to a multimillion-dollar fundraiser on Facebook for immigrant children this week.

Microsoft has a deal with ICE for use of its Azure cloud computing services, which the company wrote in a January blog post allows agency employees to “utilize deep learning capabilities to accelerate facial recognition and identification,” which is being implemented for “homeland security and public safety.” On Wednesday, Microsoft distanced itself from the agency.

“As a company, Microsoft is dismayed by the forcible separation of children from their families at the border," Microsoft said in a statement. "Family unification has been a fundamental tenant of American policy and law since the end of World War II.”

Thiel, a confidante of Trump, has supported multiple technology efforts relating to the U.S. border that contrast with Facebook’s company positions.

Thiel has reportedly considered supporting a company that wants to make a “virtual border wall” using advanced radar, infrared sensors and cameras to look out for people crossing into the U.S. illegally. That company, Anduril, is headed by Oculus VR founder Palmer Luckey, according to The New York Times. Luckey sold Oculus to Facebook for more than $2 billion in 2014, but left the company six months after it was revealed he supported a super PAC that spread anti-Hillary Clinton memes.

Neither Facebook nor Palantir responded to NBC’s requests for comment about Palantir’s work with ICE.

Palantir is not the only big data operation making millions off of ICE’s more aggressive policies.

Thomson Reuters Special Services, a subsidiary of the mass-media firm and news agency Thomson Reuters, signed a $6.8 million contract with ICE in March. The company beat out 13 other companies for the bid, including IBM, Booz Allen Hamilton, PricewaterhouseCoopers and LexisNexis.

The contract stipulates that Thomson Reuters will provide support for ICE’s Enforcement and Removal Operations unit in its “mission to locate, arrest and remove criminal aliens that pose a threat to public safety.”

Thomson Reuters Special Services CEO Steve Rubley is also on the board of the ICE Foundation, a nonprofit that "supports the men and women of ICE."

A Thomson Reuters spokesperson insisted Reuters’ newsgathering is “completely independent of any [of] our commercial relationships.” The company declined to comment on the Trump administration’s child separation policy.

“[Thomson Reuters Special Services] supplies data to ICE in support of its work on active criminal investigations with the explicit purpose to focus resources on priority cases involving threats to public safety and/or national security,” the company told NBC News in a statement.

Hewlett Packard Enterprise, which split off from Hewlett-Packard in November 2015, struck a $75 million contract with U.S. Customs and Border Protection, which oversees ICE, in September 2017 for management of the customs agency’s network operations center.

HP Enterprise has since merged with another company under the name Perspecta, but some operations remain separate. When asked about the $75 million contract, an HP Enterprise spokesperson referred NBC News to Perspecta about the deal.

Perspecta did not respond to a request for comment, but an HP Enterprise spokesperson disavowed the administration’s child separation policy, saying the company provides technology and services across the U.S. government.

“However, as a company, we are opposed to any policy that separates children from their families and urge the administration to change its policy to keep families together," the spokesperson said.

Motorola Solutions has a continuing $13.3 million contract with ICE. The contract, described as a “tactical communications program,” started in late 2017 and is projected to last until late 2019. Motorola Solutions did not respond to a request for comment.