While it’s under pressure at home for stopping production at four plants and cutting thousands of jobs, General Motors has just announced it would invest 10 billion reais ($2.65 billion) in Brazil over the next five years.

The investment will be divided equally between two of GM’s Brazilian plants located in the state of Sao Paulo. The facilities in Sao Caetano do Sul and Sao Jose dos Campos employ 15,000 people, all of which will get to keep their jobs as part of the investment plan. That’s not all: an additional 400 jobs will be created.

Previously, GM reportedly contemplated shutting down the two plants, a move that would have cost 65,000 jobs when its suppliers are taken into account. Through the Chevrolet brand, the U.S. carmaker is the sales leader in Brazil, South America’s largest car market.

“When we embarked on this path last December, we had a really serious problem, which was the future of our factories in Sao Paulo,” GM’s CEO for South America, Carlos Zarlenga, was quoted as saying by Reuters at a news conference hosted by Sao Paulo State Governor Joao Doria. The executive added that he initially doubted GM would find any way to keep the factories open.

Apparently, they did find a way, but the reasons behind its change of heart haven’t been officially announced. No details regarding production plans have been disclosed either. However, the state of Sao Paulo recently launched an incentive program promising to reduce VAT by up to 25 percent for automakers investing at least 1 billion reais (about $262 million) and generating at least 400 jobs.

Obviously, GM would qualify for the program, which actually seems tailor-made for it because the Sao Paulo government set a ceiling of 10 billion reais — precisely the amount GM pledged to invest in the state.

The Sao Caetano do Sul plant is GM’s first plant in Brazil, having opened in 1930. It currently builds five Chevrolet models: the Cobalt sedan, Montana small pickup, Cruze sedan, Cruze hatchback, and Spin MPV. Rumor has it the plant will build a new compact unibody pickup as a replacement for the Montana.

The Sao Jose dos Campos facility opened in 1958 and currently builds the Chevrolet S10 pickup (aka the previous-generation Colorado) and the closely related Trailblazer SUV. Reports say the investment allocated to this plant will go toward production of a new S10 and a new SUV.

In light of this recent announcement, we’d be willing to bet U.S. President Donald Trump will be bashing GM in five, four, three…