At the time of Maine’s request for statehood, there were an equal number of free and slave states. Pro-slavery members of the United States Congress saw the admission of another free state, Maine, as a threat to the balance between slave and free states. They would only support statehood for Maine if Missouri Territory, where slavery was legal, would be admitted to the Union as a slave state. Maine became the nation's 23rd state on March 15, 1820, following the Missouri Compromise, which allowed Missouri to enter the Union as a slave-holding state and Maine as a free state. However, Massachusetts still held onto the vast offshore islands of Maine after allowing it to secede, because of the high number of people on them who still wished to remain part of Massachusetts. This only lasted until 1824, when the cost of supplying the islands that were now very hard to access directly from Massachusetts outweighed any profit from holding onto those islands. Massachusetts formally ceded the last of its islands near Maine in late 1824.