In 1999, Portugal fully returned Macau to China. However, did they get something for giving Macau back to China, or was it just a sign of good faith and decolonization in general?
By giving up Macau quietly, Portugal avoided an embarrassment similar to the one they experienced when India took Goa.
More seriously, this was done as part of a treaty at a point in time where Portugal was carrying out a policy of de-colonization. Portugal basically offered to return Macao to China.