Although the citizens of Maine (at least the male citizens, as women could not vote) voted in July of 1819 to separate from Massachusetts (by a vote of 17,000 for independence, 7,000 against) it was far from a done deal. There was a state constitution to write and submit to Congress for approval. It was an enterprise fraught with difficulties. The major stumbling block was that at that time there was an equal number of slave states and free states. By admitting Maine as a free state it would tip the balance and southern states weren't going to allow that to happen.
"And so we had to achieve statehood by a vote of the Congress by March 4, 1820, or else we fell back into the legal possession of Massachusetts. So, we're racing a clock and we're racing uphill against political prejudice that has frozen the United States in the position of the generation since the Revolution. What happens in the House of Representatives is known as the infamous Missouri Compromise. The speaker of the United States House, a slave owner, manages to engineer a compromise that lets Maine and Missouri territory into the union at the same moment. And we accepted - with huge reservations - the deal." - Herb Adams
That deal nearly tanked the push for Maine to become a state. Five of the seven Maine congressmen voted against it as they did not want to see Maine taking part in the perpetuation of slavery but in the end the compromised passed and Maine became a state. This did not stop Maine residents, however from continuing the battle against slavery though.
Brunswick, Maine resident, Harriet Beecher Stowe, penned her famous book, Uncle Tom's Cabin in 1851. Many consider it the pivotal work in rallying people in the country to oppose slavery. Portland, Maine was also a stop on the underground railroad which helped runaway slaves on their way to freedom in Canada. Fourteen years later, the deal that gave Maine her statehood became a moot point when slavery was abolished by President Abraham Lincoln.