The British “gave it up”, like a tenant “gives up” an apartment when their lease runs out.
Technically, perhaps. We have a permanent base in Cuba, Guantanamo Bay Naval Station, and pay the Cuban government an annual lease. Since the Cuban revolution, the Castro government has not accepted the payments although the US still makes them. They say we are occupying it illegally. Is it legal or not?
Occupancy has its own legality, if you have the muscle ot keep it.