Lt. Gov. Anthony G. Brown cruised past his two rivals in Maryland’s bitter Democratic gubernatorial primary on Tuesday, setting up a November contest with GOP nominee Larry Hogan, a Cabinet secretary under the state’s last Republican chief executive.

Brown, who would be Maryland’s first African American governor and only the third elected in the nation, won just over 51 percent of the Democratic vote in an election marked by lackluster voter interest. Attorney General Douglas F. Gansler lagged far behind with 24 percent of the vote, less than two percentage points ahead of third-place finisher Del. Heather R. Mizeur (Montgomery), according to nearly complete but unofficial returns.

Hogan, an Anne Arundel County businessman won 43 percent of the Republican vote, beating Harford County Executive David R. Craig (29 percent), Charles County businessman Charles Lollar (15.5 percent) and Del. Ronald A. George (Anne Arundel), who had 12.3 percent of the vote.

Maryland’s primary season — moved up this year from September to June — also featured a fiercely contested Democratic primary for attorney general, in which Sen. Brian E. Frosh (Montgomery) came from behind to defeat Del. Jon S. Cardin (Baltimore County), the early front-runner.

Maryland’s eight members of Congress easily survived any challenges they faced from members of their own party. All 188 seats in the General Assembly were also on the ballot, and a couple of incumbents were beaten, including Senate Minority Leader David R. Brinkley (R-Frederick). In county races. Montgomery County Executive Isiah Leggett defeated his two challengers, while colorful Prince George’s County Clerk of the Court Marilynn Bland appeared to lose to challenger Sydney Harrison. Prince George’s Democrats Deni Taveras and Del. Doyle L. Niemann were separated by just 18 votes in the District 2 County Council race, with 96 percent of precincts reporting.

In addressing a boisterous group of supporters in College Park, Brown said: “This campaign isn’t about where we’ve been. It is about where we are going to build a better Maryland . . . a more competitive state with an economy that creates quality, middle-class jobs.”

Gansler congratulated Brown but continued to press his campaign themes, saying that reports of low turnout were indicative of voter dissatisfaction. “People are very frustrated,” he told a crowd in Bethesda. “The middle class is being squeezed by taxes going up and getting less from a government that’s supposed to work for them.”

Mizeur told her supporters gathered in Baltimore that “there were a lot of skeptics who said I would never make it this far. People who lead from fear told me to get back in line. But together, we showed them the power a movement can have when we work together for positive change.”

Brown led across all regions of the state, but he was buoyed by an exceptionally strong showing in his home county of Prince George’s, piling up a nearly 5-to-1 margin over Gansler.

Retired teacher Agnes Robinson, 78, said she went to the polls in Upper Marlboro for only one reason: “I want to make sure Anthony Brown wins.”

She needn’t have worried. Brown, a former state delegate and Army reservist who served a tour of duty in Iraq, even dominated in Montgomery County, the home of both Gansler and Mizeur.

For Gansler, a former state’s attorney in Montgomery, the defeat was particularly deflating. Not much more than a year ago, his campaign war chest dwarfed those of any of his potential rivals, and he was widely presumed to be the front-runner to succeed Gov. Martin O’Malley (D), who is term-limited and steps down in January.

Doug Gansler waves to a crowd of supporters at the Bethesda North Marriott Hotel after he conceded to Anthony Brown on Tuesday. (Michael S. Williamson/The Washington Post)

Mizeur’s political future could be brighter. Though she too finished well behind Brown, her spirited performance exceeded the expectations of most observers in a bid to be both Maryland’s first female governor and its first who is openly gay. Her campaign appealed primarily to the more liberal members of the party.

In addressing his supporters in Annapolis, Hogan called the current state leadership an “arrogant monopoly” that is “expecting a coronation” in the fall.

“This is a fight for Maryland’s future, and it’s a fight worth fighting,” Hogan said. “Sadly, Lieutenant Governor Brown and Governor O’Malley have a failed record of lost businesses, lost jobs, wasteful spending, record tax increases and broken promises.”

In a state where registered Democrats outnumber Republicans more than 2-to-1, Brown starts the fall race with a tremendous advantage. Brown, who was backed by O’Malley, pledged during the campaign to “build on the successes” of the past eight years with an agenda that includes expanding pre-kindergarten education and improving Maryland’s business climate.

Only one Republican has landed in the governor’s mansion in Maryland during the past generation. Hogan has vowed to follow in his footsteps by reaching out to Democrats and independents. And he has promised to roll back as many taxes as possible that were raised during O’Malley’s tenure.

Joanne Alloway, 66, a semi-retired writer, said she voted for Hogan because he seemed like the Republican most likely to win in the general election.

“He has the best shot and has the most consensus in the Republican Party,” Alloway said as she walked out of a voting booth in Annapolis. “We have extremely high taxes.”

A Washington Post poll two weeks ago showed Brown leading Hogan 51 percent to 33 percent among all registered voters in a hypothetical matchup. Both Brown and Hogan attracted large majorities of their own party members, but Brown also held an advantage among independent voters.

Hogan’s primary campaign has telegraphed the themes he is likely to press in the general election. One of his TV ads includes a shot of Brown arm-in-arm with O’Malley as Hogan tells viewers: “They never met a tax that they didn’t like, or at least one they didn’t hike.”

Brown’s camp, meanwhile, is expected to remind voters of Hogan’s close association with former governor Robert L. Ehrlich Jr., who was voted out of office in 2006 after a four-year term filled with acrimony between a Republican executive and a heavily Democratic legislature. Hogan served as Ehrlich’s appointments secretary, a Cabinet-level position that involved steering hundreds of people into administration jobs.

During the primary, the boldest proposals on the Democratic side came from Brown’s two rivals: Mizeur, for example, advocated the legalization of marijuana, while Gansler pledged to reduce the state’s corporate income tax rate to the same level as Virginia’s. Brown is expected to continue to push a middle-of-the-road Democratic agenda.

Martha Medrano, 50, of Bowie said she cast her ballot for Gansler because she identified with his ideas about taxes.

“I like Brown, but under O’Malley, taxes went up,” said Medrano, who was voting for the third time since she became a citizen.“I’m afraid [Brown will] raise them even higher.”

Brown gained an advantage in the race from its outset, declaring his candidacy in May 2013, two months before Mizeur and four months ahead of Gansler. Gansler’s team calculated that few voters would pay attention during the summer months. But Brown used the time to build a sense of momentum, naming his running mate in June and rolling out endorsements from many of the top Democrats in the state.

Just weeks after Gansler announced in September, he was hit with a pair of scandals that dogged his campaign for months: a Washington Post story about allegations that he routinely directed state troopers assigned to him to speed and run red lights; and a Baltimore Sun story about his appearance at a teen beach party in Delaware, where Gansler did nothing to stop apparent underage drinking.

Gansler soldiered on, attempting to brand himself as a candidate of ideas, issuing policy proposals on issues large and small.

Gansler also sought to contrast his record of getting things done as attorney general with that of Brown. Employing his typical bluntness, Gansler in January called Brown an “emperor with no clothes” who was being propped up by the Democratic establishment.

Gansler also sought to tear down Brown by blaming him for the botched rollout of the state’s online health insurance exchange. O’Malley had tasked Brown with overseeing health-care reforms in Maryland, but Gansler’s attack never seemed to resonate.

Some Brown voters interviewed Tuesday said they were generally happy with the direction of the state.

“[Brown] was a good lieutenant governor, and I like the governor we’ve had,” said Randall Dillard, 46, a shipping supervisor who brought his son to a polling site in Upper Marlboro. “I think he’ll carry on with the good stuff we’ve had in the state.”

Maxine Desouza, 62, a nurse from Burtonsville, said one of the reasons she turned out to vote was that she felt strongly about casting a ballot that could ultimately help to elect Maryland’s first African American governor.

“I want our kids to look to someone who has something to say and knows what he’s about,” she said.

Mizeur, whose campaign was written off early by many pundits, proved a scrappy competitor, waiting to spend her limited resources on television ads until the closing weeks of the race. She took stands well to the left of her better-known and better-funded rivals, promising to legalize marijuana, expand pre-K programs well beyond what other candidates proposed and raise the state’s minimum wage to $16.70 by 2022.

“I believe she has integrity,” Burtonsville voter Kerridwen Henry said. “She is definitely listening to the people.”