Those talks fizzled as the two sides failed to agree on terms. Instead, Target is now leading a new investment in Casper — as the mattress maker aims for an initial public offering down the road.

Casper plans to announce as soon as Monday that it has raised $170 million. The investment is being led by Target, which on Sunday began selling Casper mattresses, pillows, sheets and more in its stores and on its website.

“The reality that we face is that a vast majority of people don’t know that we exist,” Philip Krim, Casper’s chief executive, said in a telephone interview. Partnering with Target, Mr. Krim said, will help change that.

The new round values Casper at approximately $750 million, not including the new investment, according to a person with knowledge of the financing. Mr. Krim declined to comment on the valuation.

In taking the new money, as well as forging a relationship with one of the country’s biggest retailers, Casper is seeking to bolster its resources and its recognition at a time when the retail industry is in upheaval. The new financing will be announced just days after Amazon unveiled a blockbuster $13.4 billion deal to buy Whole Foods Market and Walmart struck an agreement to buy Bonobos, an internet-based men’s clothier.

Traditional brick-and-mortar sellers have struggled with the online sales revolution, which has lured away customers with convenience. And newer brands like Casper or the men’s razor maker Harry’s — born online and reliant in large part on word of mouth and social media marketing — have prospered by forgoing the expensive task of building out real-world stores, instead striking partnerships with traditional sellers when the time is right.

Mr. Krim said there was no fixed timetable for his company going public. But should Casper opt for an I.P.O., it would be one of only a few consumer-facing companies to seek the public markets over the past year.

For Mr. Krim, his company has proved that it can carve out a niche in the sleep industry. He said that Casper more than doubled sales last year, to over $200 million, though he declined to discuss whether it is profitable.

The company’s origins are well-known within the retail set. Mr. Krim and his co-founders argued that the traditional way of buying mattresses — going to a retailer like Sleep Train, for example — was hugely uncomfortable and very expensive. So they instead began selling a memory-foam mattress online that arrived in a modest-size box.

Simplicity is part of the company’s ethos. Casper offers just one type of mattress, which ranges from $550 for a twin to nearly $1,200 for a California king. Customers have 100 days to try out the mattress and can ship it back free for a full refund.

Yet the company competes in an increasingly crowded corner of the industry, with competitors including Tuft and Needle, Leesa and Purple, all of which tout their own foam mattresses, and all of which sell them online. Mr. Krim said that the growing competition had not dented sales, but instead reflected the growing power of e-commerce in what analysts at IBISWorld have reckoned is a $14 billion a year industry.

Of all those companies, however, Casper sells by far the widest variety of products, from mattresses and pillows to duvets and sheets and even a dog bed that starts at $125.

“They are gaining a much higher market potential,” Eduardo Holschneider, a managing general partner of Tresalia, a Mexican investment firm that took part in the new fund-raising. “People are really concerned about wellness.”

It is that market potential that first drew Target to Casper. Beyond the fizzled sales talks, which were reported last month by Recode and confirmed by a person briefed on the matter, the two sides discussed ways to work together.

What eventually emerged, according to Mr. Krim, was Target’s taking part in the new fund-raising round, as well as striking a partnership to feature Casper prominently in its retail channels. (Casper previously struck a similar deal with the retailer West Elm.)

Target was particularly interested in how Casper has blossomed as a primarily online-only venture.

“How the two experiences connect together is something we’re focused on at Target, and we believe working with Casper will uncover insights and open up possibilities on both sides,” Brian Cornell, Target’s chief executive, said in a statement. “I think we have a lot to learn from each other along the way.”

The new financing round also included previous investors like New Enterprise Associates, and celebrities including Kevin Spacey and the basketball player Carmelo Anthony, who said that sleep was “an essential piece to competing at the highest level in my profession.”