LONDON – Schneider Electric of France agreed on Wednesday to buy the British engineering company Invensys in a cash-and-stock deal worth £3.4 billion, or $5.2 billion.

The announcement comes after confirmation last month that the two European companies were in talks over a deal that would allow Schneider Electric, which provides low- and medium-voltage electrical equipment and services, to expand its operations globally.

Schneider Electric said it was offering Invensys shareholders a cash-and-stock deal that valued the British company’s shares at 502 pence, 14 percent above their closing price before the potential takeover talks were first announced on July 12.

The takeover price is slightly below the initial figure that was discussed by the two companies in July, but includes a cash component that is 17 percent higher than the preliminary figure.

“The addition of Invensys’ businesses will considerably strengthen Schneider Electric’s overall offering to its industrial and infrastructure customer base,” the French company’s chief executive, Jean-Pascal Tricoire, said in a statement.

Shares in Invensys rose 2.5 percent in morning trading in London on Wednesday, and those in Schneider Electric jumped 4.5 percent in Paris.

Invensys had long been touted as a takeover target after discussions broke down with Emerson Electric, which is based in St. Louis, over a potential deal last year. Invensys carries a burdensome $700 million in pension liabilities, but its financial difficulties were eased this year after the sale of its rail-infrastructure business to a rival, Siemens.

The move is the latest in a series of acquisitions by Schneider Electric, including deals in India and Spain.

Schneider Electric, whose annual revenue reached almost 24 billion euros ($32 billion) last year, has been making an aggressive push into emerging economies, where local construction and infrastructure projects continue apace despite the financial crisis.

By acquiring Invensys, which posted annual revenue of £1.8 billion last year, Schneider Electric will gain access to the British company’s large customer base in the oil and natural gas sectors, where it provides control and safety systems. Invensys also sells heating and ventilation products to large manufacturing companies.

As part of the deal, Schneider Electric said it expected around 400 million euros of revenue savings by 2018, and an additional 140 million euros in cost savings by 2016.

Barclays and JPMorgan Chase advised Invensys on the deal, while Deutsche Bank, Bank of America Merrill Lynch and BNP Paribas advised Schneider Electric.