(Reuters) - Fashion chain Bebe Stores Inc BEBE.O has clinched deals with its landlords to close its approximately 180 stores, enabling it to avoid filing for bankruptcy and continue to sell merchandise online, people familiar with the matter said on Thursday.

A Bebe store logo is pictured on a building along the Lincoln Road Mall in Miami Beach, Florida March 17, 2016. REUTERS/Carlo Allegri

Bebe has almost no debt and a significant amount of cash, so the development was rare as many of its peers filed for bankruptcy and closed their doors this year amid intense competition from online retailers and fast-changing consumer tastes.

Bebe risked having to file for bankruptcy if its landlords did not accept the deals, the sources said. Retailers often file for bankruptcy to get out of store leases, leaving landlords scrambling to recover their losses in bankruptcy court.

However, Bebe was able to offer mall owners, including Simon Property Group Inc SPG.N and General Growth Properties Inc GGP.N, better deals than what they would have received in a bankruptcy protection filing, said the sources.

Bebe plans to continue to operate online, selling its low-cut dresses, off-the-shoulder tops and short shorts without the expense of rent, the sources said. The retailer also has a partnership with licensor Bluestar Alliance LLC to further develop its brand.

The sources requested anonymity because the negotiations were private. Bebe, Simon Property and General Growth Properties did not respond to requests for comment.

BCBG Max Azria LLC, Wet Seal LLC and American Apparel LLC are just some of the U.S retailers that filed for bankruptcy in the last 12 months. Mall-based retailers in particular are going through a period of immense distress, as foot traffic in malls falls due to the rise in popularity of online shopping.

In April, Bebe said that it expected to record a charge of about $20 million related to the store closings, and that liquidators were holding store closing sales in the shops.

Bebe does not have any term loans or bonds, and had about $67 million in cash at the end of 2016, according to its financial statements.

The company said in March that it had retained investment bank B. Riley & Co to explore strategic options, and a real estate adviser to work on lease negotiations with landlords.

Bebe Chief Executive Manny Mashouf founded the company in the 1970s, and the retailer rose to fame in the 1990s and 2000s thanks in part to a fashion line it offered with reality TV stars the Kardashians. Mashouf owns about 58 percent of the company’s shares.