Ross Taylor, Associated Press
Nov. 29, 2005- Customers walk past a Family Dollar store at Hickory Grove Market in Charlotte, N.C. Dollar Tree is buying rival discount store Family Dollar in a cash-and-stock deal valued at about $8.5 billion, the companies announced Monday, July 28, 2014.

When Family Dollar announced plans in April to shutter 370 stores and slash its prices after another disappointing earnings report, most industry observers were convinced it was only a matter of time before the struggling discount retailer changed hands. The only question was who would buy it.

Hardly anyone guessed it would be Dollar Tree, a competing discount retailer. But in a surprising move announced Monday, Dollar Tree will acquire Family Dollar in an $8.5 billion cash-and-stock deal.

The merger brings together the nation's second- and third-largest discount retailers, creating an industry giant with 13,000 stores in the United States and Canada and more than $18 billion in yearly sales.

The deal reflects growing pressure on the once thriving discount-retailer model. Despite their differences, both companies, as well their thriving competitor Dollar General, cater to a demographic of consumers that felt the effects of the recession more severely and recovered from it more slowly. With slow wage growth and recent federal cuts to food stamps and unemployment benefits, many once-loyal dollar-store customers are staying home.

Family Dollar's profits fell one-third in its most recent quarter compared with the same period last year, while Dollar Tree profits have been flat.

The activist investor Carl Icahn, a shareholder who had publicly pressured North Carolina-based Family Dollar to sell itself last month, claimed Monday's deal as a victory. He said in a statement that the merger signified a "a big win for all shareholders of Family Dollar and yet another validation of the activist investment philosophy in general."

The two companies will maintain their separate brands. While Dollar Tree caters to a suburban customer base and keeps all prices at a dollar or less, Chesapeake, Va.-based Family Dollar prices some of its merchandise above a dollar and attracts lower-income consumers in urban and rural areas.

The deal further crowds the already packed marketplace with small-box discount stores. Facing their own struggles, big retailers such as Wal-Mart and Target in recent years started opening smaller stores in an effort to compete with their dollar-store competitors.

Brian Sozzi, an analyst at Belus Capital Advisors, said in an article for The Street that Wal-Mart had made a big mistake in not buying Family Dollar. He called it "the first major failure of the Doug McMillon administration," in reference to Wal-Mart's new chief executive.

But Jan Rogers Kniffen, a consultant to investors and retail companies, said he was skeptical that the deal represented a blow to Wal-Mart.

"They want to participate, they want to play, they want to be competitive in this space," Kniffen said. "But this business is not big enough to change Wal-Mart's fate."

Analysts offered tempered praise of Dollar Tree's move, saying it gave the retailer a chance to target new demographics and ward off its competitors. Yet the opportunity is accompanied by significant risks and challenges, they said, as Dollar Tree will be tasked with reversing Family Dollar's flagging fortunes while simultaneously learning a business model markedly different than its own.

To succeed, analysts said, Family Dollar's new management will have to lure low-income consumers back into the retailer's stores at pre-recession levels.

"The turnaround story at Family Dollar definitely hinges on there being continued growth in that low-end space," Fox said. "If five years from now the sales per square foot of Family Dollar don't vastly improve, it would be difficult to look back at this merger and call it a rousing success."

Family Dollar's stock jumped about 25 percent by closing time on Monday, and Dollar Tree's stock rose by 1.2 percent.