Is "In 1816, Portugal invaded the recently liberated territory and in 1821, it was annexed to the Banda Oriental of Brazil." a good answer to the question "What year did Portugal invade the recently liberated territory?"
yes