Mars Inc., the closely held maker of M&M’s candies and Uncle Ben’s rice, agreed to buy three of Procter & Gamble Co.’s pet-food brands for $2.9 billion, making it a bigger challenger to Nestle SA’s Purina empire.

The transaction, which excludes the brands’ businesses in some markets, mainly in Europe, will be completed in the second half of the year, the companies said today in a statement.

The acquisition gives McLean, Virginia-based Mars the Iams, Eukanuba and Natura brands to add to its Pedigree, Whiskas and Royal Canin lines. A.G. Lafley, who returned as P&G’s chief executive officer last year, has been working to cut costs and focus the company on core businesses.

P&G will restate fiscal 2013 and 2014 earnings by 3 cents to 4 cents from core earnings to discontinued operations. The sale won’t affect P&G’s forecast for profit growth in its fiscal 2014, which runs through June, and won’t have a material effect on fiscal 2015 results. Cash from the sale will be used for general corporate purposes, the company said.

P&G, based in Cincinnati, rose 0.6 percent to $81.86 at 9:59 a.m. in New York. The shares were little changed this year through yesterday.

Upon his return in June, Lafley started evaluating P&G’s units for potential divestitures. Analysts and investors considered Iams a natural candidate. The unit “doesn’t deliver” for P&G, Ali Dibadj, an analyst at Sanford C. Bernstein & Co. in New York, said earlier this year.

Second Tenure

Lafley’s second tenure came with high expectations. In his first round as CEO, he oversaw the $57 billion acquisition of Gillette Co., expanded P&G’s overseas presence and presided over the introduction of successful new products, such as the Swiffer cleaner.

The company in January lowered its forecast for profit and sales growth this year because of currency exchange-rate fluctuations and policy changes in Venezuela. That move followed a second-quarter earnings that topped analysts’ estimates.

For more on pet deals, see "Pet Food Experts Grows with Acquisition" and "Outlook for Pet Industry Strong."