PARIS (Reuters) - France's Schneider Electric (>> SCHNEIDER ELECTRIC) is to buy British engineer Invensys (>> Invensys plc) for an agreed 3.4 billion pounds to strengthen its high-margin industrial automation business and win more custom in the fast-growing energy sector.

Schneider said on Wednesday it would pay 502 pence a share in cash and stock, 14 percent above Invensys' closing price the day before talks between the two firms were disclosed.

That is just below an initial proposal of 505 pence a share after other bidders failed to emerge, although the cash component is higher, at 372 pence, than the original 319 pence.

The deal, Schneider's biggest since its $6.1 billion purchase of American Power Conversion Corp in 2006, will combine Invensys' automation software that helps run power stations, oil refineries and chemical plants with Schneider's automation products for the car, aerospace, food and beverage industries.

It will bolster the French group against larger players such as Switzerland's ABB (>> ABB Ltd.) and Germany's Siemens (>> Siemens AG) and give it the opportunity to cross-sell its energy efficiency products to Invensys' high energy-using customers.

"The Invensys deal is a little bit expensive, but if we discount back the synergies it looks OK," said Espirito Santo analyst Rob Virdee.

Schneider, which has been hit by a faltering world economy and a weak Europe in particular, forecast the deal would deliver 140 million euros of cost savings a year by 2016 and about 400 million euros of additional revenues a year by 2018.

Chief Financial Officer Emmanuel Babeau told reporters it would review the future of Invensys' appliance unit, which makes controls for washing machines, suggesting it could be sold.

At 1020 GMT, Schneider's shares were up 4.1 percent at 60.37 euros, while Invensys' were up 2 percent at 501 pence.

The British firm has long been touted as a takeover target in an industry dominated by larger rivals and some analysts had speculated Schneider's interest could prompt rival bids from firms such as Emerson (>> Emerson Electric Co.) and General Electric (>> General Electric Company).

The bid speculation gathered pace after Invensys sold its rail unit in November, allowing it to cut its pension deficit.

BOOSTING PROFITS

According to Reuters data, Schneider's offer values Invensys at 22.8 times forecasts for the British firm's earnings for next year. Britain's listed industrial machinery firms are on average trading at a multiple of 13.3 times earnings estimates for 2014.

The French firm said it expected the deal to boost cash earnings per share by a low to mid single-digit percentage in 2014 and by a high single digit-percentage in 2016.

Integration costs would be about 150 million euros over 2014/15, with acquisition costs of about 60 million and tax savings around 400 million over the first five years, it added.

The deal is expected to close in the fourth quarter of 2013.

Schneider said its first-half earnings before interest, tax and amortisation (EBITA) fell 2 percent to 1.53 billion euros, reflecting the economic crisis in Italy and Spain, low business confidence in France and lower spending by utilities in Germany.

But it kept its full-year organic revenue and EBITA margin targets, as organic revenues outside western Europe returned to growth in the second quarter.

"The risk for Schneider is that they have to make about a 240 basis point improvement in second half margins versus the first half to meet their current guidance, and that could be a stretch if management's focus turns more towards the acquisition," Espirito Santo's Virdee said.

JP Morgan Cazenove (>> JPMorgan Chase & Co.) and Barclays (>> Barclays PLC) advised Invensys on the deal, while Deutsche Bank (>> Deutsche Bank AG) and Bank of America Merrill Lynch (>> Bank of America Corp) advised Schneider.

($1 = 0.7547 euros)

(Additional reporting by Paul Sandle in London; Editing by Christian Plumb and Mark Potter)

By Elena Berton