Tempur-Pedic International Inc. (NYSE: TPX), known for upscale foam mattresses whose technology was developed by NASA, announced Thursday it will buy rival Sealy Corp. (NYSE: ZZ), the bedding industry leader, for $228.6 million.

Including the assumption of Sealy’s debt, which is about $750 million, Tempur-Pedic valued the transaction at $1.3 billion and said the definitive agreement calls for the creation of a $2.7 billion company.

The definitive agreement's per-share price of $2.20 represents an approximately 23 percent premium to the 30-day average of Sealy’s shares.

“Our global footprint will span over 80 countries," Mark Sarvary, Tempur-Pedic’s chief executive, said in a statement. "The shared know-how and improved efficiencies of the combined company will result in tremendous value for our consumers, retailers and shareholders.”

The deal is expected to close in the first half of 2013, though the two companies will continue to function independently since the two brands have different approaches to mattress and sleep technology -- Tempur-Pedic primarily makes "visco-elastic" technologies, commonly referred to as “tempur” material, and Sealy focuses on more traditional inner-spring mattresses. Sealy’s CEO, Larry Rogers, will continue to head his company while reporting to Savary.

By taking ownership of Sealy, Tempur-Pedic will also sever any outstanding ties the company had with Kohlberg Kravis Roberts, the private equity firm, which currently owns about 46 percent of the company.

In midday trading, Tempur-Pedic shares rose 36 cents to $36.18 while Sealy shares climbed 10 cents, or 4.7 percent, to $2.24.