Maine was part of Massachusetts before becoming a state in 1820.

The simplest version is: it was the District of Maine, under Massachusetts, until statehood in 1820.