Pedestrians pass in front of Gap Inc. and Old Navy Inc. stores in the Times Square area of New York, U.S., on Wednesday, Dec. 13, 2017. Bloomberg is scheduled to release consumer comfort figures on December 21. Photographer: Mark Kauzlarich/ Bloomberg
Mark Kauzlarich/Bloomberg/Getty Images
Pedestrians pass in front of Gap Inc. and Old Navy Inc. stores in the Times Square area of New York, U.S., on Wednesday, Dec. 13, 2017. Bloomberg is scheduled to release consumer comfort figures on December 21. Photographer: Mark Kauzlarich/ Bloomberg
Now playing
01:04
Old Navy is doing so well it's splitting up with Gap
Getty Images
Now playing
02:18
This airplane-shaped bag is selling for more than some actual planes
Now playing
00:54
See Nike's new 'hands-free' shoe
One of many large boxes of returned products that fill the warehouse. The returned products in this box will eventually be sorted and categorized.
John General/CNN
One of many large boxes of returned products that fill the warehouse. The returned products in this box will eventually be sorted and categorized.
Now playing
05:08
Here's where your 'free' online returns actually end up
Shutterstock
Now playing
04:42
Ever receive a package you didn't order? It could be a scam
Orangetheory Fitness
Now playing
02:13
This gym is actually opening studios during the pandemic
Now playing
02:24
How holiday spirit is surging despite the Covid-19 pandemic
NEW YORK, NEW YORK - NOVEMBER 19: A view of the window display as Macy's Herald Square unveils Give, Love, Believe 2020 Holiday Windows on November 19, 2020 in New York City. (Photo by Eugene Gologursky/Getty Images for Macy's)
Eugene Gologursky/Getty Images North America/Getty Images for Macy's
NEW YORK, NEW YORK - NOVEMBER 19: A view of the window display as Macy's Herald Square unveils Give, Love, Believe 2020 Holiday Windows on November 19, 2020 in New York City. (Photo by Eugene Gologursky/Getty Images for Macy's)
Now playing
00:56
Macy's unveils holiday window display with gratitude theme
CNN/Target/Design by John General
Now playing
02:36
It's official: Black Friday is irrelevant
Now playing
02:23
Party City CEO: Consumers still want to celebrate together
NEW YORK, UNITED STATES - 2020/07/08: People wearing face masks shopping inside a retail store in Manhattan as the city enters phase 3 of reopening amid the coronavirus pandemic
As New York City enters phase 3 of reopening retail stores for indoor shopping, restaurants have been postponed for indoor dinning. The U.S. Department of Health recorded a total of 3,219,999 infections, 135,822 death and 1,426,428 recovered since the beginning of the outbreak. (Photo by Braulio Jatar/SOPA Images/LightRocket via Getty Images)
Braulio Jatar/SOPA Images/LightRocket/Getty Images
NEW YORK, UNITED STATES - 2020/07/08: People wearing face masks shopping inside a retail store in Manhattan as the city enters phase 3 of reopening amid the coronavirus pandemic As New York City enters phase 3 of reopening retail stores for indoor shopping, restaurants have been postponed for indoor dinning. The U.S. Department of Health recorded a total of 3,219,999 infections, 135,822 death and 1,426,428 recovered since the beginning of the outbreak. (Photo by Braulio Jatar/SOPA Images/LightRocket via Getty Images)
Now playing
01:38
US retail sales improved in September
thehouseofdrew.com
Now playing
02:01
Justin Bieber's footwear collaboration overwhelms site
Walmart
Now playing
01:01
See what's new inside Walmart stores
3119 E Third Street Dollar General in Dayton, OH on March 12, 2020.
Maddie McGarvey for CNN
3119 E Third Street Dollar General in Dayton, OH on March 12, 2020.
Now playing
06:07
Dollar General's business is booming. It's also vulnerable to crime, police say
Now playing
03:01
How private equity is gutting retail
Now playing
01:55
All retail bankruptcies are not the same. Here's what you need to know
(CNN Business) —  

Bankrupt Gymboree has found a buyer for its brands. The Children’s Place and Gap have agreed to purchase most of what’s left of the company.

It’s the latest shakeup in the sector as brick-and-mortar stores try to find their footing in a challenging environment.

Children’s Place will spend $76 million to acquire the rights to the Gymboree and Crazy 8 brands, and will take over the contract for Gymboree Play & Music, which was spun off in 2016, according to court documents filed Saturday.

Gap appears to be going all-in on Gymboree’s more upscale Janie and Jack brand. It’s paying $35 million for the online business and leases to Janie and Jack stores, with an additional agreement to buy Janie and Jack’s inventory.

The moves follow Gymboree’s decision in January to file for bankruptcy for the second time in less than two years.

The company said unexpectedly difficult conditions in the brick-and-mortar retail industry forced them back to bankruptcy. Disappointing sales also led to steep discounts on merchandise, adding to Gymboree’s problems. It said in January that it would close 800 stores.

The acquisitions by Children’s Place and Gap, two former competitors, still need court approval. Neither company immediately returned a request for comment on Sunday.

The purchases make sense for Children’s Place and Gap because the kids’ clothing market is booming. It grew more than 4% last year.

Many parents are choosing to have children later in life, which means they have more disposable income to spend on their kids’ wardrobes, according to Ayako Homma, an analyst who tracks the children’s clothing market at Euromonitor International.

Gap’s decision to scoop up Janie and Jack, which has more than 100 US stores, also indicates that the company plans to build out its brand portfolio on the heels of the Old Navy spinoff.

The company said last week that it will split in two, separating Old Navy from another business that includes Gap, Banana Republic and other brands, such as Athleta.

The move is designed to let Old Navy expand on its own while the new Gap hones its strategy.

“I am pleased to welcome Janie and Jack to the Gap Inc. family and to expand our portfolio into the premium kids and baby business,” Gap CEO Art Peck said in a statement.

Children’s Place, meanwhile, is pursuing a turnaround by pushing online sales and courting Millennial moms.

“The Gymboree acquisition provides us with the opportunity to revitalize the Gymboree brand across various channels,” CEO Jane Elfers said in a separate statement. “We have always had a great deal of respect for the loyal Gymboree customer.”

— CNN Business’ Chris Isidore and Nathaniel Meyersohn contributed to this report.