WASHINGTON — Maine residents voted to send President Barack Obama back to the White House on Tuesday.

Although it appeared early Tuesday night that Republican Mitt Romney might have a chance of claiming one of the state’s four electoral votes, the Associated Press confirmed at around 10:30 p.m. that the president had won them all.

The Associated Press called Maine’s statewide race for Obama moments after the polls closed at 8 p.m. It represents the sixth consecutive victory for a Democrat in a state that was a Republican stronghold for generations.

Although early returns were still coming in, Obama’s margin of victory in Maine is expected to be considerably smaller than in 2008 when he defeated Republican John McCain by nearly 18 points. But the president’s message continued to resonate with many voters, despite a slow economic recovery.

“I think we’re headed in the right direction,” said Julie Blodgett, a school teacher from Cumberland who voted for Obama. Giving the president four more years, she added, will allow him to fully implement his agenda.

Jim Melcher, a political science professor at the University of Maine at Farmington, said the statewide result was not a surprise.

“Maine has not gone for a Republican for president since 1988,” Melcher said Tuesday night. “It’s been that way for some time and the polls have been pretty consistent about that.”

The one outstanding question on Tuesday was whether Romney could take advantage of Maine’s vote-splitting system and pick up one electoral vote by winning the 2nd Congressional District. Maine and Nebraska are the only two states in the country that split their electoral votes, awarding two to the statewide victor and then one vote to the winner of each congressional district.

“My hunch is Obama is going to carry it but it is probably going to go late,” Melcher said.

Maine was largely overlooked by both campaigns during the 2012 election due to the president’s lingering popularity in the state and history of supporting Democratic nominees.

Neither candidate stumped for votes in Maine nor sent any high-profile surrogates to the state. Neighboring New Hampshire, by contrast, was a top destination for both men as they battled for the slightest advantage with the Granite State’s closely divided electorate.

With the national race too close to call, however, Romney and his supporters began looking for every last electoral vote. That led them to Maine’s sprawling and more conservative 2nd Congressional District, where recent polls suggested the Republican was chipping away at Obama’s lead.

Unlike the other 48 states, Maine and Nebraska allow their electoral votes to be split up. Both states award the overall winner two electoral votes and then one vote for each congressional district. Maine has never split its vote in the 40-plus years the system has been in place.

But the prospect of a single electoral vote in what could a razor-thin election was enough to prompt a major pro-Romney PAC, Restore Our Future, to reserve an estimated $300,000 in airtime in Maine. Melcher said that was a wise investment given Maine relatively inexpensive television advertising rates.

Once a Republican stronghold, Maine is now reliably Democratic when it comes to presidential picks. Mainers have not voted to send a Republican to the White House since George H. W. Bush in 1988, despite electing or re-electing two Republican senators during that time.

Mainers also donated much more generously to Obama than to Romney this year. The president raised $5 for every $1 collected by Romney – or $2.5 million compared to $536,000 – according to the most recent data compiled by the Federal Election Commission.

In South Portland, Clara Whitney, 27, and her husband, Peter, 30, both Democrats, said they were excited to cast their ballots for Obama.

“I think he’s done a great job, considering the circumstances, and I was happy to vote for him again,” said Clara Whitney, who works at Good Shepherd Food Bank. “He inherited a terrible economy and he kept if from collapsing. And he started if growing again, despite a lack of bipartisan support.”

Meanwhile, two generations of the Rice family from South Portland – John and Cindy, both 60, and their 23-year-old daughter, Jackie – cast their ballots for Romney. John’s a retired electrical contractor. Cindy’s a middle school health teacher. Jackie’s a recent college graduate who’s looking for a marketing job. All are Republicans.

“I figured Obama had four years and I didn’t see much change, like he promised,” Jackie Rice said. “I feel Romney will contribute a lot more.”

Still other voters described the choice as a lesser of two evils or lamented the hyper-partisan atmosphere in Washington.

Mark Balles of Falmouth was among the latter, adding that it would difficult for anyone to lead if the situation does not improve.

“I’m not sure I can be proud of our country with the extreme partisanship that has gone on,” Balles said.

Asked which of the presidential candidates would stand the best chance of leading he replied: “We’ve had Mr. Obama for the last four years. Do we feel we’re working together better now than we were four years ago?”

Portland Press Herald reporters Kelley Bouchard and David Hench contributed to this report.

CORRECTION: This story was updated at 9:55 a.m. Friday, Nov. 9, 2012, to reflect that the Rice family lives in South Portland.