Toys "R" Us said it plans to close about 180 locations around the country. CEO Dave Brandon wrote in a customer letter that the store closings are designed to strengthen the company as it seeks to emerge from bankruptcy protection.

In a court document, Toys "R" Us said it will close up to 182 underperforming locations spread across the U.S., representing about one-fifth of its stores. It added that the final decision on shuttering stores will depend on whether the company is able to negotiate more favorable lease terms or rents for some locations. The store closings will begin in February and wind down in April, Brandon said.

The closures follow a holiday season when bricks-and-mortar retailers struggled to compete with the growing popularity of online retailers like Amazon.com. Toys "R" Us had the added challenge of filing for bankruptcy protection in September, just as stores were stocking up for the holidays.

Get Breaking News Delivered to Your Inbox

"The actions we are taking are necessary to give us the best chance to emerge from our bankruptcy proceedings as a more viable and competitive company," Brandon wrote.

Toys "R" US said it's requesting bonuses for employees who remain with the stores through their closures.

Aside from changing shopping habits, the company had struggled with a heavy debt load from a $6.6 billion leveraged buyout by private-equity firms Bain Capital and KKR & Co. in 2005. At the time, the deal was touted by a KKR executive as a chance to "make the stores a better place to shop and work. But the debt hobbled the company's ability to invest in new initiatives and fend off tech powerhouses like Amazon.

The plan had been to take the company public again, but weak sales have prevented that from happening.

While its numbers have been shrinking, Toys R Us still sells about 20 percent of the toys bought in the U.S. according to Stephanie Wissink, an analyst at Jefferies LLC.

Competitive pressures will force the company to take a close look at all of its stores, and more will likely be shuttered over the next year or two, Wissink said.

Toys R Us reigned supreme in the 1980s and early 1990s, when it was one of the first of the "category killers" - a store totally devoted to one thing: toys. Its scale gave it leverage with toy sellers and it disrupted general merchandise stores and mom-and-pop shops.

Now Toys R Us and other category killers like the now-defunct Sports Authority, Borders and Circuit City, are being upended by a new force: Amazon.com. GlobalData Retail estimates that about 13.7 percent of toy sales were made online in 2016, up from 6.5 percent five years ago.

Toys R Us has been hurt by a shift to mobile devices as well, which take up more and more play time.

About three dozen retailers sought bankruptcy protection last year due in large part to a radical shift in consumer behavior, both in where they shop, and what they buy.

Toys R Us closed its flagship store in Manhattan's Times Square, a huge tourist destination, about two years ago.

The struggles of Toys R Us have rippled outward and rumors continue to swirl around the possibility of a merger between Mattel and Hasbro, the nation's largest toy makers.

Wissink estimates that Toys R Us accounts for about 11 percent of Mattel's annual sales and about 9 percent of Hasbro's annual volume. Shares of both Mattel Inc. and Hasbro Inc. slipped in early trading.

"(Toys R Us) store closings will reduce rent expense and allow the company to focus all of its operating efforts on only its best locations," said Moody's lead retail analyst Charlie O'Shea in a report published Wednesday.

The Associated Press contributed to this story.