Children's apparel retailer Gymboree was able to sell its brand to rival Children's Place, while Gap plans to acquire the bankrupt retailer's high-end children's clothing line Janie and Jack, a bankruptcy court document shows.

Children's Place will pay $76 million for the rights associated with both Gymboree and its Crazy 8 brand, and it will take over a contract with Singapore-based Zeavion Holding. In 2016, Zeavion acquired the retailer's Gymboree Play & Music business, which operates independently.

Meanwhile, Gap, which announced on Thursday plans to split into two separate companies, said it will buy Janie and Jack's intellectual property, its website, customer data and other assets for $35 million. In a separate deal, it also plans to buy the chain's inventory from a liquidation company.

Both transactions must be approved by the bankruptcy court.

Gymboree filed for bankruptcy protection in January, and said it would close 800 Gymboree and Crazy 8 stores. It was its second bankruptcy in less than two years.