The luxury One Bal Harbour hotel and residences have been spared more drama and higher legal fees.

The owners of the residential and hotel condos and the owner of the common areas and amenities agreed late Tuesday to work together to sell a portion of the glass tower at 10295 Collins Ave. in Bal Harbour.

Elcom Hotel & Spa and affiliate Elcom Condominiums own the building’s shared facilities, which include a spa, restaurant, pool, lobby, elevators and valet parking. They are now officially on the market. The sale would allow Elcom and its affiliate to emerge from Chapter 11 bankruptcy. The facilities are expected to fetch about $17 million, enough to pay off creditors.

The unit owners agreed to let Elcom take control of the facilities through a chief restructuring officer, who would replace a state court-appointed receiver.

The appointee, former Miami-Dade Circuit Judge Jorge Perez, has been running the facilities since Elcom Hotel & Spa was removed from its day-to-day operations amid allegations of mismanagement in 2011. Until Friday, the residential and hotel condo owners opposed Elcom’s plan for a restructuring officer and wanted a bankruptcy trustee to run the shared facilities.

After intense negotiations, the parties agreed to retain the Atlanta-based financial adviser Algon Group to manage and market the facilities. They also agree to retain Harvey Gurland of Duane Morris as special litigation, real estate and hospitality law counsel to advise on issues related to condo documents and the sale but not operations.

Both sets of advisers would not be allowed to charge more than $30,000 for the first two months. That term sought to appease the unit owners who are concerned about the bills generated by the receivership. It is estimated they owe Perez and his law firm, McDonald Hopkins in Miami, about $2 million.

The residential condo association and the hotel condo association have been in litigation against Elcom and its affiliates since 2010. The sale of the shared facilities would bring an end to their disputes.