HARTFORD, Conn. — Democrat Dan Malloy has won Connecticut’s gubernatorial election after days of back-and-forth over vote totals and irregularities, yet his Republican opponent is reviewing the numbers to see if he can make up the margin.

The Associated Press reinstated its call Friday of Malloy as the winner of the governor’s race. The AP’s complete but unofficial count shows Malloy winning by 7,762 votes.

Secretary of the State Susan Bysiewicz posted vote tallies Friday that showed Malloy, the former Stamford mayor, leading Republican businessman Tom Foley by 5,637 votes, also well above the 2,000-vote margin that automatically triggers a re-count.

Bysiewicz has until Nov. 25 to certify the results. They would make Malloy the first Democrat to hold the governorship since William O’Neill, who left office in 1991. The current governor, Republican M. Jodi Rell, did not seek re-election.

Friday’s tally from the state’s 169 cities and towns was posted shortly after two police officers delivered much-anticipated paper copies of ballots from Bridgeport, the last municipality to report its results to the state. City election officials were waylaid by a lack of ballots on Election Day and round-the-clock tallying.

Bridgeport, where President Barack Obama appeared last weekend to rally Democrats, ultimately provided Malloy, 55, with the votes needed to propel him into the lead.

The latest results posted by the secretary of the state show Malloy winning with 566,498 votes from the Democratic and Working Families Party lines. Foley garnered 560,861 votes, while Independent candidate Tom Marsh won 17,586 votes. The numbers could fluctuate before the election is certified.

Foley told the AP after its election call that his campaign planned to spend the weekend reviewing the latest results and voter problems across the state to see if enough votes are outstanding to make up the margin that separates him and Malloy.

He said it doesn’t make sense for him to concede until those issues are reviewed.

“We just want to confirm that it’s reliable and unlikely to change,” Foley said of Malloy’s margin of victory. The Greenwich businessman has voiced concern about fluctuations in vote totals posted on the secretary of the state’s website and various inconsistencies, such as a now-infamous bag of photocopied ballots found at a Bridgeport polling place.

“Connecticut deserves to know accurately what the result was of the vote on Tuesday and it may well take a re-count to get that certainty,” Foley told reporters Friday morning, adding how he wanted to meet with Bridgeport election officials and possibly Malloy’s campaign to review the ballots.

Foley has left open the possibility of a legal challenge, possibly persuading a judge to order a re-count. Chris Healy, the state Republican chairman, said attorneys for both the state GOP and Foley have talked about possible legal options but no decisions have been made. He said a lawsuit likely wouldn’t be filed until after Bysiewicz certifies the results.

“We’re obviously going to take our lead from Tom Foley because he’s our standard bearer and he’s the aggrieved party,” Healy said.

Malloy said in a statement that he and his running mate, Comptroller Nancy Wyman, appreciated and respected Foley’s perspective.

“But as Nancy and I have been since early Wednesday morning, we are 100 percent confident that we have been chosen by the voters to be Connecticut’s governor and lieutenant governor,” he said, “and chosen by a margin comfortably outside what is required for a re-count.”

Malloy has said that he and Wyman have accepted a tough mission, given Connecticut’s multibillion-dollar deficit and job losses.

“The state is in dire shape and we need to begin the process today of recreating Connecticut in a different economic model,” he said on Tuesday. “We are confident that we can do that.”

Both the Malloy and Foley campaigns have begun forming transition teams.

The AP initially called Malloy the winner on Wednesday, after Bysiewicz said her preliminary count showed Malloy had won by 3,103 votes.

The AP withdrew its call Wednesday night when its own updated vote count showed Foley ahead. That count did not include complete reports from both New Haven and Bridgeport, two of the most heavily Democratic towns in the state. The New Haven figure relied on by the AP was mistakenly listed as complete; it was not clear how the error occurred.

Malloy ended up winning more than 80 percent of the vote in each city, enough to erase the lead Foley held in the AP count Wednesday night.