Germany's TUI AG said it may try again to float its stake in Hapag-Lloyd as part of its bid to exit completely from the shipping business, after it failed to agree a full sale to the container shipper's other shareholder.

TUI said on Tuesday that as part of a deal with the Albert Ballin consortium, Hapag's majority shareholder, it would cut its stake in the container shipper to about 22 percent from 38.4 percent and that it stands to receive 700 million euros in cash from the consortium.

Eying a complete exit from container shipping to focus on its tourism operations, TUI retains the right to call for an IPO of Hapag with priority placement of the shares held by TUI any time from June.

TUI also remains entitled to sell the remaining Hapag shares to investors outside the Ballin consortium, it added.

The cash inflow is to be used to further reduce debt and hence enhances the scope in core business Tourism, TUI said.

The Ballin consortium, named for the former Hapag boss credited with inventing the cruise, is a group of investors led by the German city state of Hamburg and Klaus-Michael Kuehne, majority owner of Swiss logistics group Kuehne & Nagel .

The group owns almost 62 percent of Hapag-Lloyd.

TUI originally tried to sell a majority stake in Hapag-Lloyd in 2008. That attempt was derailed by the global financial crisis, meaning TUI kept a larger stake than it originally intended.

Last year, plans for a flotation of the stake were scuppered by financial market turbulence and discussions with other investors from China and Oman failed to result in a deal.

Reuters reported earlier this month that TUI would only sell part of its stake as a compromise to keep Hapag-Lloyd in German hands, while making the deal affordable for the city of Hamburg and other consortium members.

TUI, which controls London-listed TUI Travel , is due to report first-quarter results on Wednesday, when it also holds its annual shareholder meeting.

Earlier on Tuesday, the city of Hamburg said it had reached an agreement over Hapag-Lloyd.

(Reporting by Jan Schwartz; writing by Victoria Bryan and Ludwig Burger; Editing by Helen Massy-Beresford)