AUGUSTA, Maine — Maine Republicans and Democrats have until Friday to switch parties if they want to vote in any primary elections set for June 14.

In a news release Monday, Maine Secretary of State Matthew Dunlap said state law requires a 15-day waiting period after a change of enrollment before a citizen can cast a ballot in that party’s primary or participate in its caucus or convention.

Since the Memorial Day holiday is May 30, the deadline for party enrollment is May 27, Dunlap said.

Maine recognizes three qualified political parties: Democratic, Republican and Green Independent. All other registered voters are considered “unenrolled,” whether they consider themselves independent voters or members of other political parties that are not qualified in Maine, such as Libertarian and Socialist.

According to the release from Dunlap’s office, unenrolled voters can enroll in a party at any time, including on Election Day, although they must still abide by the 15-day waiting period for participation.

Registered voters who are enrolled in one of the three qualified parties must meet certain deadlines to change their party affiliation before primary elections in which their party is choosing its candidates.

Under state law, voters must remain in a party for three months before they are eligible to file an application for withdrawal or a change in enrollment. Additionally, those who withdraw from a party are ineligible to enroll in a different party for 15 days.

Only 20 states offer open primaries, where all registered voters are allowed to participate in primary elections. Registered but unenrolled voters in Maine may still vote for the candidate of their choice in general elections.