Ben Jealous, left, and Ben Cohen, right, a co-founder of Ben and Jerry’s, give out free ice cream in Baltimore on Saturday. (Marvin Joseph/The Washington Post)

U.S. Rep. Steny H. Hoyer (D-Md.), right, stumps for gubernatorial candidate Rushern L. Baker III on Saturday. (Cheryl Diaz Meyer)

The two front-runners in the Maryland Democratic gubernatorial primary went home to their bases this weekend after spending much of the past week reaching out to undecided voters in areas of the state where they are less known.

Prince George’s County Executive Rushern L. Baker III crisscrossed his county trying to shore up votes before Tuesday’s primary, while his chief rival, former NAACP president Ben Jealous, did the same in the Baltimore area. At a circus, festivals, small receptions and church services, the candidates shook as many hands, took as many selfies and covered as much ground as they could before voters cast their ballots.

Analysts say the race between Baker and Jealous could be decided by who has the best ground game, especially since polls in early June showed many likely voters had not closely focused on the race.

“Everything counts,” said John T. Willis, a political science professor at the University of Baltimore. “It’s the combination of ingredients — the poll workers, the robo-calls, the live calls, the dropping [campaign literature] — in the last week that makes a difference.”

More than 220,000 Maryland voters cast ballots during eight days of early voting — a 57 percent increase from 2014 that likely reflects both the number of competitive state and local races and the growing popularity of voting ahead of time.

Willis attributed part of the surge to “discontent with the Trump administration” in Maryland, where registered Democrats outnumber registered ­Republicans more than a 2-to-1 ratio.

Volunteers prepare to put up signs for Rushern L. Baker III’s campaign for governor. (Cheryl Diaz Meyer/For The Washington Post)

In addition to nominating a Democrat to challenge Gov. Larry Hogan (R) this fall, voters will choose nominees in county executive, county council and school board races in Prince George’s and Montgomery counties and in the closely watched 6th Congressional District race, where Del. Aruna Miller is in a tight battle with businessman David Trone on the Democratic side and ­defense consultant Amie Hoeber is the front-runner among the ­Republicans.

The gubernatorial primary has largely come down to a two-man matchup between Baker and Jealous, mirroring the 2016 presidential primary battle between Democratic establishment favorite Hillary Clinton and her left-leaning challenger, Sen. Bernie San­ders (I-Vt).

The other candidates are state Sen. Richard S. Madaleno Jr., a veteran lawmaker from Montgomery County; Alec Ross, a tech entrepreneur; James Shea, former chairman of the Veneble law firm; and Krishanti Vignarajah, a former policy director to Michelle Obama.

Hogan is unopposed for the Republican nomination.

Over the weekend, volunteers for the candidates knocked on doors and set up phone banks. They mainly targeted the four major Democratic strongholds of Baltimore City and Baltimore, Prince George’s and Montgomery counties, although the Jealous campaign said it was also making calls to other parts of the state, including Anne Arundel, Charles and even Harford counties, more conservative areas where there are growing African American communities.

Jealous, a first-time candidate, is relying heavily on unions to mobilize their members. The campaign has three field organizers — one of whom worked on the campaign of Sen. Doug Jones (D-Ala.) — running a team that includes more than 1,000 volunteers, many of whom signed up at events where Sanders was campaigning with Jealous. Their targets: black voters, Latino voters and voters who supported Sanders in 2016.

Ben Jealous chats with Latasha Walker while campaigning in Baltimore. Ben and Jerry’s ice cream co-founder Ben Cohen listens in. (Marvin Joseph/The Washington Post)

“Our belief is that if we can carry Latino voters statewide and are competitive with African Americans in Baltimore and the progressives across the state, that will be enough to put us where we need to be to win,” Jealous spokesman Kevin Harris said.

The Jealous campaign is hoping to hold Baker to 55 percent of the vote in Prince George’s — which has the most registered Democrats of any jurisdiction in Maryland — and place second behind him there while winning in neighboring Montgomery.

Baker, a veteran officeholder in Maryland, is counting on the support of more than 60 current and retired elected officials who are reaching out to their constituents and political bases, essentially acting as precinct captains on his behalf.

“Come check this out,” said an enthusiastic Julian E. Jones, a Baltimore County Council member who ran into Baker in the parking lot of the Randallstown Community Center while early voting was underway last week.

On the screen of his laptop was a mock-up of his new campaign literature: a sample ballot topped by a photo of Jones and Baker. “Reelect Julian E. Jones and Rushern Baker,” the flier said.

Baker campaign spokeswoman Madeleine Russak said the county executive and his running mate, state prosecutor Elizabeth Embry, had visited more than 50 early voting centers, and their canvassing operation had knocked on an average of 45,000 doors a month since April. Campaign officials said they will have volunteers for Baker or his surrogates at the most active and largest polling stations in the state Tuesday.

“We’ve been building our ground game for a year to prepare,” Russak said. “We’re reaching new voters every day.”

Rushern L. Baker III gives supporters and volunteers in Greenbelt a pep talk on Saturday. (Cheryl Diaz Meyer/For The Washington Post)

Baker took a break from campaigning Friday to focus on his official duties, celebrating the construction of a new bridge and a golf facility, among other things. On Saturday, he spoke to volunteers at his campaign headquarters in Greenbelt, reminding them that all the projects and ribbon-cuttings he’d presided over for nearly eight years had led to jobs that allow families to pay their bills and provide for their children.

“This is about people. About all of you,” Baker said, surrounded by bright green campaigns signs and flanked by Rep. Steny H. Hoyer (D-Md.), former governor Martin O’Malley and others. “When you call folks and you say, ‘Listen, we’ve cut crime in half in Prince George’s County,’ that’s not it. That means there are less people who’ve been murdered, that means less people who’ve been robbed. . . . We don’t want that just for us. We want that for everyone.”

Jealous, a community organizer since his teenage years, knocked on doors in West Baltimore with union volunteers on Saturday and touted his plans to reduce mass incarceration, raise the minimum wage to $15 an hour and bring down the cost of college.

Ben Jealous, who is running for governor, greets supports in Baltimore on Saturday. (Marvin Joseph/The Washington Post)

“This is the part that I love, just pure organizing,” he said.

“Hi, I’m Ben Jealous,” he told Ruth James when she opened her front door. “I know who you are,” James said, smiling.

Jealous offered up his progressive credentials and talked about his grandmother, who grew up nearby, and the Baltimore church his family attends. Then he asked if she had any questions.

“I’m just about there, and you may have tipped me over the edge,” James said.

A union volunteer checked her name off. She’d receive a follow-up call before Tuesday.