President-elect Donald Trump and Carrier have reached a deal that will keep nearly 1,000 factory jobs in Indiana, the company said on Tuesday.

Carrier poses an early critical test for Trump, who promised during the campaign to keep American jobs from fleeing to Mexico.

Trump and Mike Pence, the vice president-elect and current governor of Indiana, will be in Indiana on Thursday to announce the deal, Carrier said.

The company, which is owned by defense contractor United Technologies, announced in February that it would close two Indiana plants -- a Carrier plant in Indianapolis that employs 1,400 workers and a United Technologies Electronic Controls plant in nearby Huntington, Indiana, that employs 700.

Carrier did not elaborate on the terms of the deal, but it is on the record, as are most other major multinational businesses, as wanting to see a cut in corporate tax rates, especially as it applies to cash earned overseas.

The fate of the more than 400 remaining jobs in Indianapolis was not immediately clear. Nor was it clear whether the 700 jobs at the Huntington plan would be saved.

The company planned to send that work to Mexico starting next year, a move that would have saved it $65 million a year in labor costs, according to the union that represents the workers.

United Technologies is a leading defense contractor that benefits from billions of dollars in federal spending, so it needs to maintain good relations with the incoming Trump administration.

United Technologies collects about $5.6 billion in annual revenue from U.S. government contracts, according to company filings, which is equal to about 10% of its overall revenue. The government also pays for nearly $1.5 billion of the company's annual research and development spending.

Trump took to Twitter late Tuesday to thank Carrier.

"Big day on Thursday for Indiana and the great workers of that wonderful state. We will keep our companies and jobs in the U.S. Thanks Carrier," he wrote.

Big day on Thursday for Indiana and the great workers of that wonderful state.We will keep our companies and jobs in the U.S. Thanks Carrier — Donald J. Trump (@realDonaldTrump) November 30, 2016

In response to a CNBC report that Carrier will receive "new inducements" from Indiana, trade attorney Scott Lincicome, an adjunct scholar at the libertarian Cato Institute, criticized the deal.

"'New inducements'" = Subsidies," Lincicome wrote, adding "CONGRATULATIONS INDIANA TAXPAYERS! YOU INVOLUNTARILY BOUGHT AN INEFFICIENT AC FACTORY."

And there it is. "New inducements" = Subsidies. Spearheaded by fmr. Indiana Governor Pence. #draintheswamp https://t.co/ecJMtSssO9 — Scott Lincicome (@scottlincicome) November 30, 2016

Justin Wolfers, a professor of economics at the University of Michigan, commented that the deal could set a troubling precedent.

"Every savvy CEO will now threaten to ship jobs to Mexico, and demand a payment to stay," Wolfers wrote on Twitter, adding "great economic policy."

Every savvy CEO will now threaten to ship jobs to Mexico, and demand a payment to stay. Great economic policy. https://t.co/t2WAJOgh8F — Justin Wolfers (@JustinWolfers) November 30, 2016

In a Facebook post Tuesday, Trump heralded the deal as "great news" and said more details were forthcoming.

Dan Scavino Jr., Trump's director of social media, said on Facebook: "[N]ot even in office yet, #PEOTUS & #VPEOTUS are getting things done in-between their 2017 Transition meetings."

--CNN's Robert Ray contributed to this report.