LEWISTON — U.S. Sen. Ted Cruz of Texas defeated Republican presidential front-runner Donald Trump during heavily attended Maine caucuses Saturday.

Cruz won nearly all of the state’s 16 counties, securing 45.8 percent of the votes cast. Trump had 32.5 percent, followed by Ohio Gov. John Kasich with 12.1 percent and U.S. Sen. Marco Rubio of Florida with 8 percent. Candidates who have suspended their campaigns also received votes.

Cruz was unable to secure more than 50 percent of the votes cast. As a result, he and the other candidates will share a portion of the delegates.

Cruz won 12 delegates, Trump had nine and Kasich two.

Cruz’s Maine victory was part of his strong showing in the four states that caucused Saturday, leading the freshman senator to reiterate his claim that he is the only candidate who can beat Trump, the populist insurgent whose rise to front-runner status has confounded the Republican establishment.

Maine Republican Party officials reported that 18,650 Republicans voted at 20 locations across the state. In 2012, only 5,814 votes were cast during Republican caucuses.

“The Republican Party is back in Maine and we are resurgent,” said Maine Republican Party Chairman Rick Bennett, adding that the party added thousands of new voters over the past month.

Maine was one of four states where Republican voters participated in party voting contests Saturday. The others were Louisiana, Kansas and Kentucky. Puerto Rico, which has the same number of Republican delegates as Maine, will hold Republican caucuses Sunday.

Two leading contenders for the overall nomination, Trump and Cruz, held rallies in Maine on Thursday and Friday, respectively. Their presence in the state underscored how contentious, and unpredictable, the Republican selection process has become.

During an energetic rally at the University of Maine in Orono, Cruz argued that he’s the only one who can defeat Trump and Democratic front-runner Hillary Clinton. On Thursday, Trump made his case in Portland with the backing of Gov. Paul LePage.

In Androscoggin County, Cruz received 662 votes, Trump 482, Rubio 118, Kasich 102, Ben Carson six, Carly Fiorina four, Rand Paul three and Jeb Bush one. Carson, Fiorina, Paul and Bush have all suspended their campaigns. The Androscoggin County totals foreshadowed the proportional distribution of delegates by the end of the night.

Maine results

Trump supporters showed up in force Saturday. Peter Mantell, a volunteer working the Trump table at Biddeford Middle School, repeatedly found himself giving bad news: He was out of Trump stickers, buttons and signs. And he ran out early, he said.

“It was like a bunch of piranhas came here and gobbled up everything,” he said.

Many of the Trump supporters appeared to be like Mantell – first-time caucus participants. Mantell, who lives in York, said the real estate mogul and television personality had the “moxie and the guts” to turn the country around. He said the candidate had inspired a movement. “We’re pissed,” he said.

Matt Angotti of Biddeford said he also intended to vote for Trump. He likes Cruz, but he’s worried Clinton will use the candidate’s hard-line conservative views to defeat him in the general election.

“He’s unconventional and he’s conservative on the issues that matter, immigration and terrorism,” Angotti said of Trump. “He’s more middle of the road on other issues and that’s OK.”

In Cumberland, one of three caucus spots in Cumberland County, voters started showing up an hour before the doors opened at 8 a.m. at Greely Middle School. They stood in line until the polls opened at 9:30 a.m. to cast their ballots. Many of those in line said they were there to help bring about change.

“We need a big change in our country,” said Donna McNally of New Gloucester, a Trump supporter making her maiden appearance at a political caucus.

On Saturday, Republicans voted by ballot, a departure from past years, at 20 locations across the state. Fewer locations and the apparent interest from new Republican caucus participants produced long lines at all of the polling sites. While some participants were unhappy with the long waits, others were encouraged by the turnout.

Tim Bryant, warden for the caucus in Cumberland, said there was no way for him to assess the turnout there, due to a number of major changes to the process, including far fewer locations. But, he said, people who turned out appeared energized. “It’s terrific and wonderful for democracy,” he said.

Democrats caucus across the state Sunday.

Kim Wessel of Brunswick, an independent voter for the last 34 years, said she decided to become a Republican and caucus this year because she didn’t want Trump to get the nomination. She said she was voting for Cruz, and she was repelled by the level of debate among the Republican nominees.

“You can’t even let children in the room when Trump speaks on television, or Rubio,” she said.

Jacob Small, 17, of North Yarmouth was among the youngest voters at the caucus in Cumberland. Small, who will turn 18 before Novemeber’s election, said he had put a lot of thought into his choice of Rubio.

“The other candidates are too far right. He is a little more moderate. He has a good tax plan,” Small said.

Bart Ladd of Falmouth, a former Georgia state legislator, said Kasich had been on his radar for decades for his work on a balanced federal budget. “Kasich is the only adult in the room,” he said.

Tristam Coffin of Bailey Island, another caucus newbie, said he entered the caucus Saturday morning without a clear choice of candidate in mind. “I haven’t decided,” he said.

Early arrivals at the caucus of Kennebec County Republicans in Chelsea managed to squeeze into the cafeteria area to hear speeches by Gov. Paul LePage and 2nd District U.S. Rep. Bruce Poliquin before the two cast their ballots.

LePage stumped unabashedly for Trump, saying he was second choice to New Jersey Gov. Chris Christie, who halted his campaign and threw his support behind Trump. “I realized it was not the year of the governors, because the governors are considered establishment,” LePage said.

LePage decried both Cruz and Rubio, saying he didn’t want another junior U.S. senator in the White House to follow Barack Obama, and that the skill sets for a senator were different from those of an executive.

The Kennebec Journal contributed to this report.