US carmaker Ford announced Monday it would cease production in Brazil and close its three remaining plants there after more than 100 years of operating in the country.

Ford has had consecutive losses in recent years, which will lead to pre-tax write-downs of around 4.1 billion dollars, the company said.

Chief executive Jim Farley said it was a “very difficult but necessary” decision.

Brazil’s Economic Ministry said it regretted Ford’s decision, which it said was at odds with the strong recovery seen in most of the country’s industrial sectors.

Thousands of employees are affected, according to a report by Brazilian news site G1.

The plants in Camacari in the state of Bahia and Taubate in the state of Sao Paulo are to be closed immediately, while production at the Troller subsidiary in Horizonte in the state of Ceara is to continue for a few months.

The metalworkers’ unions of Taubate and Camacari called for demonstrations on Tuesday.

Ford has had difficulties internationally for some time and recently only made profits in its US home market.

In addition to Europe, South America is a major problem area for the US company, with an operating loss of 108 million dollars in the last quarter.

The company celebrated 100 years of operations in Brazil in 2019.