Infineon Technologies AG agreed to buy Cypress Semiconductor Corp for about $8.7 billion in cash, the latest mega-deal for an industry grappling with slowing growth.

The $23.85 a share offer is a 34% premium to Cypress’s Friday close, and is 50% above the price the stock was trading at on May 29, when Bloomberg first reported takeover interest in the San Jose, California-based company. Including debt, the deal values Cypress at 9 billion euros ($10 billion), the companies said in a statement.

Buying Cypress will hand Infineon a memory chip maker re-positioning itself as a provider to automobiles and other connected devices. The semiconductor industry has been reshaped over the past five years as companies combine to gain scale while fighting rising costs and shrinking customer bases. NXP Semiconductors NV recently announced a $1.76 billion deal for Marvell Technology Group Ltd.’s Wi-Fi connectivity business, while Nvidia Corp. agreed to buy chipmaker Mellanox Technologies Ltd. for $6.9 billion in March.

Cypress shares were trading at $22.05 premarket in New York, below the offer price. Infineon fell as much as 7.1% in Frankfurt to its lowest level since November 2016, and S&P Global Ratings put the German company on review for a possible ratings downgrade, citing concerns over financing.

Infineon until now has mostly sat on the sidelines amid consolidation in the industry. It’s lost almost a third of its value over the past year, as the European chipmaker twice revised its forecasts to account for global economic uncertainty and a slowdown in Chinese car sales.

Infineon’s reported plans to acquire Cypress may result in some arduous integration work, with the buyer focused on power chips and the target on Internet of Things and specialty memory. Infineon makes about a quarter of its sales in China, which has turned into a headwind as the economy slows. It will need stronger 2H sales to meet its 8 billion-euro sales guidance.

Infineon’s target designs and manufactures flash memory chips and microcontrollers, or chips used for powering small electronic devices.

Cypress has been trying to recast itself as a provider of chips for use in vehicles and the growing market for so-called internet of things, the push by the electronics industry to connect devices. It’s told investors it expects its automotive business to grow 8% to 12% over the next five years and its IoT unit to expand at as much as 14% in that period.

Annual revenue, helped by an acquisition, has more than doubled in five years to $2.5 billion in 2018. Analysts are predicting that sales growth will disappear this year, forecasting a contraction of about 11%, according to the average of analysts’ estimates from data compiled by Bloomberg.

“This will accelerate the company’s path of profitable growth of recent years,” Infineon said in its statement.

It remains to be seen whether Infineon can win the necessary regulatory approvals in the midst of escalating trade battles. China effectively killed Qualcomm Inc.’s planned $44 billion takeover of NXP Semiconductors NV last year by withholding its blessing for more than 20 months. China later said it was not to blame for the deal falling apart.