Updated to reflect analyst comments throughout

NEW YORK ( TheStreet) -- A drawn-out dance between ConAgra Foods ( CAG) and Ralcorp Holdings ( RAH) proves that patience in dealmaking can pay off for shareholders.

Just over year ago, Con Agra was making a third unsolicited push to buy Ralcorp, a maker of private label cereals, snacks and condiments for $5.2 billion. After Ralcorp rejected the offer, the company instead spun off its Post Cereals ( POST) unit in early 2012.

Now ConAgra has agreed to buy Ralcorp for $90 a share in cash, proving that Ralcorp management's refusal to give in to early takeover was a savvy move that's netted longtime shareholders a higher price and a sizeable stake in the strongly performing Post spinoff.

ConAgra's price values the company and its debt at $6.8 billion. Ralcorp shares surged over 26% in Tuesday afternoon trading to $88.80, while ConAgra shares gained nearly 5% to $29.62.

On Tuesday morning, Mario Gabelli, the head of money management firm Gabelli Asset Management and a large Ralcorp shareholder, took to Twitter to celebrate the terms of Tuesday's deal.

Gabelli highlighted ConAgra's $90 a share bid, which is below that the company's final unsolicited 2011 bid of $94 a share, and the merits of the Post spinoff, which gave investors one Post share for every two Ralcorp shares they owned.

"Deals,deals and more Deals... ConAgra and Ralcorp (RAH) to merge (finally) ...RAH to get $90... One year ago, RAH spun-off POST...patience," wrote Gabelli in a breathless, but optimistic tweet.

Gabelli Asset Management holds over 2% of Ralcorp and Post Holdings outstanding shares, according to Securities and Exchange Commission filings compiled by Bloomberg.

ConAgra's $90 a share purchase price, "coupled with the amount shareholders received in Post Foods when it was spun out in February, values each pre-split share of Ralcorp at roughly $107, solidly above ConAgra's $94 bid last year," wrote William Blair Jon Andersen, in a note to clients that also highlighted Ralcorp missed on fiscal fourth quarter and full-year earnings on Tuesday.

KeyBanc Capital Markets analysts calculate that ConAgra's acquisition could add double digits to the company's full year 2014 earnings estimates, which the firm now forecasts at $2.24 a share. The deal also furthers ConAgra's private label foods presence and bolsters international expansion efforts, according to KeyBanc.

ConAgra said the deal will be financed with a mix of cash, the use of credit facilities and debt issuance, via a commitment from Bank of America Merrill Lynch. To maintain its investment-grade credit ratings, ConAgra also said it might issue up to $350 million in new equity.

In the background of ConAgra's multi-year push for Ralcorp is a bitter fiscal debate that's moved from a summer 2011 debt ceiling standoff to a present fight over a so-called 'fiscal cliff' of budget cuts and tax increases.

Both budget dramas have had real consequences for investors and for corporations looking to map out growth strategies.

After the debt ceiling led to the downgrade of the U.S. government's bond rating by Standard & Poor's, companies retreated from merger and acquisition talks and some like Ralcorp decided to spin off business units, in a move to boost share prices amid an uncertain economic outlook.

While spinoffs were all the rage for the likes of Ralcorp, ConocoPhillips ( COP), Pfizer ( PFE), Tyco ( TYC) and Kraft Foods ( KFT) in late 2011 and early 2012, Tuesday deal may indicate slimmed down conglomerates are now more viable takeover targets.

Meanwhile, uncertainty over the outcome of the 'fiscal cliff' may make some companies like Ralcorp more amenable to M&A negotiations, after ConAgra's initial offers were unsolicited and rejected in short order.

For ConAgra, Ralcorp's private label foods businesses spanning multiple supermarket aisles will help it become one of the biggest packaged foods companies in the U.S, with $18 billion in annual revenue. ConAgra's acquisitions come at a time when competitors like Kraft, Sara Lee ( SLE) and J.M Smuckers ( SJM) are in the process of trimming down their operations.

"We believe the balanced combination of our very significant branded food business, the largest private label food business in North America, and our important commercial food businesses, will enable ConAgra Foods to deliver even greater value and innovation to our customers and consumers, and sustainable profitable growth to our shareholders," Gary Rodkin, chief executive of ConAgra, said in a press release on Tuesday.

"We are proud of Ralcorp's track record of shareholder value creation and view this transaction as the culmination of those efforts," added Kevin J. Hunt, CEO of Ralcorp.

-- Written by Antoine Gara in New York

More from Mergers and Acquisitions

Apple Buys Tesla? Amazon Buys Sears? 3 Dream Mergers That Just Make Sense

Apple Buys Tesla? Amazon Buys Sears? 3 Dream Mergers That Just Make Sense

AT&T-Time Warner Ruling Could Usher in More Healthcare Deals

AT&T-Time Warner Ruling Could Usher in More Healthcare Deals

Dropbox Soars in Third-Straight Record-Setting Session

Dropbox Soars in Third-Straight Record-Setting Session

Decision on AT&T's Merger With Time Warner Marks a Monumental Week for M&A

Decision on AT&T's Merger With Time Warner Marks a Monumental Week for M&A

JPM's Head of North America M&A Wants to Super-Charge M&A and Hire More Women

JPM's Head of North America M&A Wants to Super-Charge M&A and Hire More Women