(Reuters) - ConAgra Foods Inc (>> ConAgra Foods, Inc.) sealed a deal to buy Ralcorp Holdings Inc (>> Ralcorp Holdings, Inc.) for $5 billion, more than a year and a half after first bidding on it, turning the maker of Chef Boyardee pasta into the top U.S. producer of store-branded foods.

ConAgra said on Tuesday it will pay $90 per share in cash, a premium of 28 percent to Ralcorp shares' closing price on Monday.

The deal creates a packaged food giant with $18 billion in annual sales -- from branded foods like Slim Jim meat snacks and Hunt's ketchup to foods that stores brand as their own.

It marks a victory for ConAgra Chief Executive Gary Rodkin, who began pursuing Ralcorp in March 2011 with an offer of $82 per share. After raising its bid twice, ConAgra walked away from its then-final offer of $94 per share, which valued Ralcorp at $5.2 billion.

"The circumstances were different than they are today, but the strategy is the same," Rodkin told Reuters. "We have been very, very true to our strategy."

Rodkin said last year ConAgra wanted to acquire more brands and expand its footprint in private label, where sales growth has often outpaced that of branded food, especially as offerings improve and consumer spending remains limited by lingering unemployment. The company has struck deals for several purchases since being spurned by Ralcorp.

The deal is also a win for activist investor Keith Meister, founder of Corvex Management, Ralcorp's largest shareholder. Corvex demanded in August that Ralcorp either sell itself, buy another company or change its strategy, after a disappointing performance following its refusal to talk to ConAgra and the subsequent spin-off of Post Holdings (>> Post Holdings Inc).

Meister, who founded Corvex in 2010 after seven years with Carl Icahn, joined the Ralcorp board in October.

The companies expect the deal to close by March 31 and modestly benefit ConAgra's financial results for fiscal 2013.

Separately on Tuesday, Ralcorp reported better-than-expected quarterly results, posting adjusted earnings of 92 cents per share versus analysts' estimates of 87 cents, according to Thomson Reuters I/B/E/S.

Ralcorp's shares rose 26.5 percent to $88.87 on the New York Stock Exchange. ConAgra shares rose as much as 5 percent to$29.68, their highest level in nearly eight years.

NO OVERLAP, MORE DEALS TO COME

Ralcorp is a top maker of private label cereal, pasta, crackers, jams and jellies, syrups and frozen waffles -- categories where ConAgra does not have a large presence.

"For the most part, we do not compete with ourselves," Rodkin said, noting that ConAgra plans to drive the private label business by bringing to it some skills of a branded company, such as product innovation.

The deal also broadens ConAgra's exposure to faster-growing retailers with robust private-label brands, like Whole Foods Market Inc (>> Whole Foods Market, Inc.) and Costco Wholesale Corp (>> Costco Wholesale Corporation), he said.

Shares of rival private-label food manufacturer TreeHouse Foods Inc (>> TreeHouse Foods Inc.) also rose on Tuesday, as the offer for Ralcorp ignited speculation about deals involving TreeHouse.

For TreeHouse, the Ralcorp deal is "a positive catalyst" as it "temporarily ties up the two other major private-label buyers in the acquisition landscape," Suntrust Robinson Humphrey analyst Bill Chappell said in a note.

"With other strategic acquirers gone, financial players would surely struggle to bid up deal prices," said Janney Capital Markets analyst Jonathan Feeney.

ConAgra's Ralcorp purchase was valued at $6.8 billion including debt. It will be funded with cash on hand and new borrowings from BofA Merrill Lynch.

ConAgra said it will issue $350 million of equity. It will also maintain its annual dividend of $1.00 per share and significantly reduce share buybacks while it pays down debt from the deal. It hopes to resume merger activity later.

Centerview Partners and BofA Merrill Lynch are financial advisers to ConAgra, while Barclays and Goldman Sachs & Co are advising Ralcorp.

(Reporting by Siddharth Cavale in Bangalore and Dhanya Skariachan and Martinne Geller in New York, writing by Jessica Wohl in Chicago; Editing by Sriraj Kalluvila, Ted Kerr, David Gregorio and Andrew Hay)

By Martinne Geller and Siddharth Cavale