A federal judge has approved a lease-terminating agreement between the Port of Oakland and one of its biggest tenants just six years into the company’s 50-year lease.

Outer Harbor Terminal LLC, which runs one of five container terminals at the Oakland port, filed for bankruptcy protection in January shortly after announcing plans to shut down its operation there. As part of the bankruptcy proceedings, OHT negotiated a settlement with the port to pay about $3 million per month in rent through March and an additional $5.1 million for clean-up and repairs. A Delaware federal bankruptcy judge approved the agreement last week.

The port’s Maritime Director John Driscoll, in an earlier statement on the settlement, said he was “not pleased” that the terminal was closing, but that the port was focused on a “smooth transition” for cargo shippers. That has included shifting cargo to the port’s four other container terminals, and operating extended hours at some cost to the port.

The port had budgeted about $36 million in annual revenue from its tenant for the current fiscal year, with annual increases built in for the duration of the lease. A spokesman said port officials have been in negotiations to lease part of the terminal property, and they hope to recoup some of the lost revenue.

The company’s decision to end operations in Oakland comes as major ocean carriers are consolidating, forming alliances and sharing space on larger ships. As ships have grown in size, fewer ports now have the necessary equipment or infrastructure to handle them, which can require billions of dollars in investment.