Major problems at the Maine Democratic presidential caucus Sunday have led a party lawmaker to push for a switch to primaries in the future.

Bernie Sanders is projected as the winner in the state, where there was a record turnout with an estimated 46,800 Democrats caucusing, according to party officials.

So many voters showed up in Portland that a line thousands strong wrapped around a city block.

To make matters worse, the city clerk's office left before new voters could be registered and processed.

Staff members at the caucus are requesting verbal declarations of the voters' statuses as Democrats. Portland Mayor Ethan Strimling is pledging to authenticate those votes Monday if the voters stay and caucus Sunday.

Additionally, voters were given the option of casting votes with absentee ballots instead of staying for the caucus.

The Maine Democratic Party's executive director defended the Portland clerk's office in a statement.

"Our municipal clerks' offices across the state have worked hard to process same-day voter registration for today's caucuses," wrote Jeremy Kennedy. "In Portland, the clerk's office remained at the caucus site for an additional four hours to make every effort to ensure as many people as possible could participate."

[NATL] Highlights From the 2016 Campaign Trail

Meanwhile, Portland Sen. Justin Alfond, the Senate's Democratic leader, is announcing emergency legislation to bring back the primary system in Maine.

"We can do better than this, and that's why we're going to need to have a bigger discussion," Alfond said.

"If we don't have a primary, we have to plan better for the caucus," said Strimling. "People are standing in the cold for hours just to be able to practice their constitutional right to vote."

Yes. Apology needed and apology made. I am sorry for what happened today. Won't happen again on my watch. @maine_chirps @MaineDems — Ethan Strimling (@mayorstrim) March 7, 2016

Alfond says he will be introducing the bill Monday to have both parties use primaries instead of caucuses.