Maryland Gov.-elect Larry Hogan, a Republican, receives a call from New Jersey Gov. Chris Christie after beating Democrat Anthony Brown, not pictured, in the state's gubernatorial race Wednesday, Nov. 5, 2014 in Annapolis, Md. (Steve Ruark/AP)

Republican businessman Larry Hogan pulled off a stunning upset in heavily Democratic Maryland on Tuesday, winning the governor’s race against Lt. Gov. Anthony G. Brown by relentlessly promising to roll back tax increases and chart a new direction for the state.

Shortly after midnight, Brown conceded a race that he lost despite the strong support of the state’s Democratic establishment and visits to Maryland in the closing weeks of the campaign by President Obama, first lady Michelle Obama, former President Bill Clinton and Hillary Rodham Clinton.

Hogan’s victory — a repudiation of the eight-year tenure of Gov. Martin O’Malley (D) — means that Annapolis will return to divided government for the first time since 2006. It remains to be seen how much Hogan and his running mate, Lt. Gov.-elect Boyd Rutherford, will be able to accomplish with a Democratic-controlled legislature. Their victory sent a strong message that Marylanders had grown weary of the tax increases enacted under O’Malley, which Hogan harped on throughout the campaign.

“Wow, what a historic night in Maryland,” Hogan said to a screaming crowd at his victory party in Annapolis. “They said it couldn’t be done here in Maryland. But together, we did it.”

Hogan said he received “a very gracious call” from Brown, and he asked his supporters to give a round of applause to the lieutenant governor and to O’Malley. Instead, they chanted, “Larry! Larry! Larry!” Hogan also said he received a phone call from New Jersey Gov. Chris Christie (R), who visited Maryland four times on his behalf.

Hogan, the owner of an Anne Arundel County real estate business, had argued that electing Brown would be tantamount to giving O’Malley a third term. Touting his private-sector negotiating skills, Hogan has pledged to do more to work with Democratic legislative leaders than the state’s previous GOP governor, Robert L. Ehrlich Jr., who had an acrimonious four years in Annapolis.

With more than 90 percent of precincts reporting, Brown was winning handily in Montgomery and Prince George’s counties, and he was well ahead in the city of Baltimore. But turnout appeared fairly low in those populous jurisdictions. And Hogan led everywhere else, including in the Baltimore suburbs. That was the region that in 2002 paved the way to victory for Ehrlich, who hired Hogan as a member of his Cabinet.

“Tonight, we fell short of our campaign goals,” Brown told supporters at what turned out to be a subdued gathering at the University of Maryland at College Park. “It was a tough campaign. But it was tough because there’s a lot at stake, a lot worth fighting for.”

Brown, the son of a Jamaican father and a Swiss mother, was attempting to become the first African American governor of Maryland and only the third elected anywhere in the nation. He would also have been Maryland’s first lieutenant governor to ascend to the state’s top job.

Instead, he faced some of the same difficulties as other deputies who have sought a promotion from voters. After spending eight years in the shadows, he struggled to distinguish himself from O’Malley and provide a rationale for his election.

Rather than offering voters a strong vision for what he would do in office, Brown focused much of his campaign on telling the public that Hogan had a “dangerous” agenda, particularly on social issues.

Hogan attracted enough Democratic votes to prevail in a state where Republicans are outnumbered more than 2-to-1 in party registration. And he did so despite being outspent by Brown. Hogan is the first candidate elected governor after opting into the state’s public financing system, which limited direct spending by his campaign to about $2.6 million during the general election — about half of what Brown raised.

Both campaigns benefited from millions in spending by the state parties and partisan groups working to elect governors nationwide. In an appearance at a rally Sunday night in Baltimore, Christie, chairman of the Republican Governors Association, predicted that Hogan would pull off the biggest upset in the country Tuesday.

Many voters interviewed at the polls seemed to be enduring, rather than enjoying, the election, often showing more interest in defeating one of the nominees than in helping the other to victory.

Brown supporters, in many cases, expressed satisfaction with O’Malley, while supporters of Hogan were harshly critical, saying they want a different direction for the state.

“I think we need somebody that will really focus on, ‘What can I do for Maryland to lower the unemployment rate, to raise the salaries?’ ” said Maria De La Cruz Magowan, 49, an economist from Bethesda.

At a Rockville polling place, Larry Ingram, 73, a businessman and registered independent, said Maryland’s taxes are too high, that the state should have a higher standard of living and that he doesn’t want to see businesses leave the state. He voted for Hogan.

“I’d like to see a Republican for this state,” he said. “The mood of the nation is fed up.”

Tanya Gary, 50, a magazine administrator who lives in Fort Washington, voted for Brown. “Republicans are not offering anything,” she said. “They just want to tear things down.”

In other races, Sen. Brian E. Frosh (D-Montgomery) easily defeated Republican Jeffrey N. Pritzker, a Towson lawyer, in the race to become Maryland’s next attorney general. Comptroller Peter Franchot (D) handily won another term, beating Republican challenger William H. Campbell.

Seven of Maryland’s eight congressional incumbents won their bids for another term by wide margins: Republican Andy Harris and Democrats Chris Van Hollen, C.A. Dutch Ruppersberger, John P. Sarbanes, Donna F. Edwards, Steny H. Hoyer and Elijah E. Cummings.

With most precincts reporting in the 6th District, first-term Rep. John Delaney (D) had a narrow lead over Republican Daniel Bongino, a former Secret Service agent.

Montgomery County Executive Isiah Leggett (D) and Prince George’s County Executive Rushern L. Baker III (D) won their bids to secure another term. Every seat in the state Senate and House of Delegates was also up for election.

Voters passed a measure creating a “lockbox” for state transportation funding, but Prince George’s voters narrowly defeated a proposal to limit County Council members and the county executive to three terms in office rather than two.

In Baltimore County, Jessica Baldwin, 27, said she voted for Hogan because it had become increasingly difficult for her friends to find well-paying work. Taxes, she said, have become too much. “You don’t see a return from it a lot of the time,” she said.

Hogan promised throughout his campaign to roll back as many as possible of the tax increases enacted under O’Malley — 40 by his count.

Brown did not campaign heavily on racial themes. But in the closing weeks of the contest, Democrats reminded African American voters of the historic nature of his campaign, sending mailers that included both painful and inspiring scenes from the civil rights era.

Both campaigns went negative from the outset. On the day after his primary win, Hogan released a Web ad calling Brown “the most incompetent man in Maryland.” It was a reference, in part, to Brown’s role in the state’s botched rollout of the online health insurance marketplace established under the federal Affordable Care Act.

Brown, meanwhile, launched a barrage of television ads assailing Hogan’s “agenda” for Maryland, including his positions on guns. One provocative ad showed an assault rifle resting against a swing set, highlighting Hogan’s opposition to a year-old gun control law that banned 45 types of those weapons and included new fingerprinting and registration requirements to own a handgun.

Hogan insisted that he had no plans to roll back the law, but the issue became harder to deflect when the National Rifle Association endorsed him late in the campaign and awarded him a grade of A-minus on its issues, based in part on a questionnaire that Hogan refused to make public.

Even on Election Day, several voters said they still didn’t know much about either of the major-party gubernatorial candidates or what they would do in office. A few complained about the barrage of negative television ads.

“The candidates went about it as if it was a slug fight,” said Reginald Payne, 52, a liquor store manager who lives in Prince George’s and voted for Brown.

Diana Zhou, 32, a federal contract worker from Bowie, said she was going to vote for Hogan, but she studied his Web site and did not think his action plan was comprehensive. She voted for Brown, although she was not completely sold on him.

“I’m not a fan of either one,” Zhou said.