SAO PAULO/ESSEN (Reuters) - Thyssenkrupp AG (>> ThyssenKrupp AG) has struck a deal to sell its loss-making Brazilian steel mill CSA to Ternium SA (>> Ternium SA (ADR)) for 1.26 billion euros ($1.3 billion), ending a foray into the Americas that led to billions of euros in losses.

Including debt, the deal announced by the two companies late on Tuesday gives CSA, the largest foreign investment project ever in Brazil, an enterprise value of 1.5 billion euros.

The sale was at a much lower price than the $3 billion initially expected by analysts but rids Thyssenkrupp of its Steel Americas business that once comprised CSA and an Alabama plant that was sold in 2014. Losses from the business have added up to 8 billion euros over the years.

Thyssenkrupp finance chief Guido Kerkhoff said on Wednesday the deal was also "clearly a positive signal" for talks between the German group and India's Tata Steel (>> Tata Steel Limited) over a possible merger of their European steel units.

Thyssenkrupp is forced to take a 900 million euro writedown on CSA with the sale to Ternium, which will push it to a net loss this financial year, but it expects its net debt to shrink significantly when the sale is completed by end-September.

The news pushed shares in Thyssenkrupp up 4.9 percent to the top of the STOXX Europe 600 index <.STOXX> and Germany's blue-chips <.GDAXI> by 1235 GMT on Wednesday.

"With the disposal, an important milestone in the transformation of the company can be reached and the very negative chapter 'Steel Americas' can be closed, which should outweigh the negative equity aspect," DZ Bank analyst Dirk Schlamp said in a note.

Analysts also said the sale would reduce the company's exposure to foreign exchange fluctuations as well as possible risks from U.S. President Donald Trump's "America first" promise, which could imply border taxes on imports.

At the start of the decade, Thyssenkrupp decided to shift its focus from steelmaking to concentrate on more profitable businesses such as elevators, submarines and car parts and to expand in Europe.

The sale of CSA shrinks the proportion of sales generated from steel to less than 25 percent.

Reuters reported in October that ThyssenKrupp and Ternium, a steelmaker in the Italian-Argentine Techint Group of industrial companies, were in advanced talks.

In a statement, Ternium Chief Executive Officer Daniel Novegil said the additional slab production from CSA, located in Santa Cruz in Rio de Janeiro state, would generate "new integration opportunities" with existing units in Mexico and Argentina.

($1 = 0.9522 euros)

(Additional reporting by Maria Sheahan; Editing by David Clarke and Mark Potter)

By Guillermo Parra-Bernal and Matthias Inverardi

Stocks treated in this article : Ternium SA (ADR), ThyssenKrupp AG, Vale SA, Tata Steel Limited