In 1816, Portugal invaded the recently liberated territory and in 1821, it was annexed to the Banda Oriental of Brazil.