TOKYO -- Yusaku Maezawa, once seen as one of his country's few successful internet entrepreneurs, has also burnished a reputation for quirky pursuits, be it collecting Jean-Michel Basquiat paintings or talking about his desire to travel to space.

Now the billionaire who built an online clothing empire is being talked about for his willingness to part with his eBaby, whose success has faltered.

Zozo, the operator of Zozotown, Japan's largest online fashion retailer, on Thursday announced an agreement to sell itself to Yahoo Japan, part of SoftBank Group.

Zozo founder and CEO Maezawa retired from the company the same day, giving up on his 20-year quest to create a global apparel giant that rivals Fast Retailing, parent of Uniqlo, and Inditex, known for its Zara stores.

Maezawa's company has suffered a series of high-profile setbacks in recent years, including the failure of Zozosuits, the polka-dot bodysuits distributed for free to help shoppers take their measurements so they can order clothes without trying them on. It has also been abandoned by some important brands, whose minders were irked by Zozo's new discount program.

Maezawa said he will "pursue a new path," though he did not specify what that might be. It could have something to do with his space aspirations, or with his interest in managing a professional baseball club.

"I will resign as president on this occasion, leave the future of Zozo in the hands of my successor and embark on treading a new path," he tweeted Thursday morning.

Maezawa's relationship with Yahoo Japan dates back to 2010, when he met SoftBank chief Masayoshi Son for the first time. Son immediately took a liking to Maezawa, inviting the young entrepreneur to enjoy the special bath for VIP guests at SoftBank's Tokyo head office. With the two men luxuriating in the bath, Son proposed that Maezawa launch a Chinese version of Zozotown with Alibaba Group, the Chinese e-commerce giant partly owned by SoftBank.

"I am the president of SoftBank and you are the president of Zozo," Son said. "Give me your answer here right now."

Maezawa agreed.

Although Zozo has since withdrawn from China, Maezawa and Son have maintained their relationship. In July, Maezawa offered to sell Zozo to Yahoo, according to a source. After Maezawa and Son discussed a business tie-up under PayPay Mall, a new e-commerce site Yahoo is planning to launch as early as this autumn, serious discussions about Yahoo's purchase of Zozo began.

The apparel business occupied much of Maezawa's time during the past two decades. Now he will be free to seek a spot aboard SpaceX's next-generation rocket and become the first private citizen to circle the moon.

Maezawa has said he would invite five to eight artists and performers to accompany him aboard the BFR, a super-heavy-lift launch vehicle to be developed by Elon Musk's SpaceX. The ship's first flight is scheduled for 2023.

The Zozo founder decided to retire from his company because training to be on a rocket traveling to the moon requires a lot of time, sources said.

His pursuit of a clothing empire had hit hard times. At the end of May, Maezawa apologized to over 1,200 executives of brands selling their products through Zozotown.

"I am sorry for having caused big trouble to you," he told the executives gathered in Chiba, east of Tokyo. "We will enhance our support to companies operating online shops on our website."

Earnings have rebounded since Zozo pledged to do more to support its retail partners.

The company's group sales in the April-June quarter grew 6% to 28.1 billion yen ($259 million), and net profit increased 28% from a year earlier to 5.3 billion yen. It was the first time in two years for the company to chalk up second quarter net profit growth.

Maezawa's departure has angered some brands on the Zozotown site. "How dare he run after promising to enhance support," one industry executive said.

Until recently, Maezawa was telling senior executives that he had not given up on the Zozosuit nor on the company's struggling private label.

For better or worse, Zozo's rapid growth has been powered by Maezawa's business acumen and charisma.

But he has always had a certain disdain for the life of the Japanese executive. That dislike was kindled decades ago while spending an hour and a half on Tokyo trains every morning on his way to the prestigious Waseda University-affiliated Jitsugyo High School.

"Looking at the gloomy salarymen on the train every day," he once said, "I thought, 'I never want to be like them.'"

Maezawa will be succeeded by Kotaro Sawada, the director in charge of the Zozotown business.

With Zozo's charismatic and visionary CEO on his way to the moon, or perhaps to his baseball field of dreams, the company's long-term viability will be tested.