Serta Simmons Bedding will merge with direct-to-consumer mattress company Tuft & Needle, executives told CNBC on Tuesday.

The deal will be one of the first to combine a legacy mattress company with the upstart online brands that have infiltrated the industry over the past few years. Serta Simmons will seek to take advantage of combining Tuft & Needle's e-commerce infrastructure and capabilities with Serta Simmons' retail reach.

Selling in stores helps to alleviate the cost of customer acquisition, which has grown for digital brands over the past few years as competition for online eyeballs has exploded. It also provides an easier way for customers to test a product. Tuft & Needle, Casper and other online competitors offer 100-night trials for free.

Terms of the deal were not disclosed.

"The merger will change the industry in a significant way," said Serta Simmons CEO Michael Traub. "We will be able to serve consumers unmatched both online and in-store."

Atlanta-based Serta Simmons has roughly $3 billion in revenue and calls itself the largest manufacturer, marketer and supplier of mattresses in North America. Its brands include Serta and Beautyrest, and it distributes its products across more than 10,000 retail storefronts. It was acquired by private equity firm Advent International in 2012 for $3 billion, according to media reports at the time. Serta Simmons declined to comment on that reported valuation.

Tuft & Needle, founded in 2012 by JT Marino and Daehee Park, sells mattresses, bedding and bed furniture. Its mattresses, which it sells under the brand names T&N and Mint, sell for as little as $350 for a twin bed and $750 for a California King size bed.

The company, which doesn't have outside investors, generated $170 million in sales last year. It sells on Amazon and has retail partners that include Crate & Barrel.

It is one of a number of upstart mattress firms to emerge in the last few years, which have grown traction by selling beds at a significant discount to traditional brands, while also emphasizing marketing its products online. Other companies in the industry include Casper and Purple.

"We have realized that over the past few years, the direct-to-consumer [business] has grown drastically," said Traub, who added he expects the market share of such brands to be roughly 20 percent in 2018.

Serta and Tuft & Needle are calling the deal a "merger" to reflect the transformational impact they expect the deal to have on the companies. Tuft & Needle will keep its headquarters in Phoenix, where it will run the e-commerce platform for all of the combined company. Marino and Park will be joining the new company's leadership team.

"Consumers are shifting to finding retail stores on their phones," said Marino, "That's something we've mastered — how to drive traffic into those retail stores. It's probably the most important thing to our retail partners that they haven't figured out."

The deal, meantime, comes as one of Serta Simmons' retail partners, Mattress Firm, is in duress, The retailer rapidly expanded it footprint to take advantage of the historically strong economics of a mattress store. It has struggled, though, amid fractured relations with Tempur Sealy, an accounting scandal engulfing its parent and new competition from upstarts.

"Mattress Firm is an important strategic partner and we will support them through those challenges," said Traub.

For Serta Simmons, the deal comes six years into private equity ownership, at a point at which many are wondering whether an initial public offering is the next logical step. Some companies that are weighing IPOs have sought to bulk up their e-commerce business as means to offer more growth to the public market.

Moody's Investors Service recently downgraded Serta Simmons' corporate rating to B3 from B2, as its leverage has increased due to weak operating performance and high material costs.

"It is a great combined company," said Traub. "We are creating value for customers, consumers and ultimately investors."