Answer:
There are a few territories that fit this description, but the most well-known is probably Texas. Texas was a part of Mexico until it gained its independence in 1836, and then it was an independent republic until it was annexed by the United States in 1845 and became the 28th state.