After fighting each other across 38 primaries and caucuses from Maine to American Samoa, Hillary Clinton and Bernie Sanders have stumbled across a new conundrum in Tuesday’s primaries: Other Democrats in the midst of their own heated contests at the same time.

When voters in Maryland and Pennsylvania head to the polls Tuesday to weigh in on the presidential primary, they’ll also be picking a winner in two of the Democratic Party’s most contentious Senate primaries in the country.

The contests have presented new and unique challenges for both candidates and their allies, who have had to tread carefully through both states in order to avoid alienating voters or interest groups aligned with either candidate.

view photo essay Political Theatre: The presidential campaign of Hillary Clinton Clinton arguably boasts experience in government unparalleled by anyone in the presidential field — but that has also made her a high-profile target for attack.

Maryland in particular has become a political minefield. It has not only the most divisive Democratic Senate primary in country, but two congressional primaries – including one where a self-funding candidate has spent an unheard of $12 million – and a fractured mayoral race in Baltimore, the state’s largest city.

“This is a time when you just try to love everyone,” said Parris Glendening, the former governor of Maryland, on how the presidential candidates have navigated the state’s tricky political waters.

The Senate race, between Reps. Chris Van Hollen and Donna Edwards, has often been compared to the presidential primary. Van Hollen, with his establishment backing, is seen as a Clinton analog while Edwards, with her progressive outsider message, is seen as Sanders.

RELATED: This Senate race could make history

But in fact, the race is a jumbled Gordian knot of interest groups and demographic and ideological factions that would be impossible for Clinton or Sanders.

Edwards, who is black, may have Sanders’ agenda, but she has Clinton’s base: African-Americans and women. And while Van Hollen sounds like Clinton as he touts his effectiveness and experience in the closing days of the trail, his support base is white liberals, much more akin to Sanders’.

While Edwards has the backing of liberal groups like Democracy for America, which endorsed Sanders, she also the support of Emily’s List, one of Clinton’s staunchest allies, which has spent close to $3 million on her behalf.

Van Hollen has some key union backers like SEIU, which has endorsed Clinton, and is also seen as having the tacit support of the White House.

“Everyone is being viciously agnostic in this one because they know what a hotbed it is,” said one Democratic operative close to the race, who spoke on the condition of anonymity given the sensitivity of the race.

Both Edwards and Van Hollen have endorsed Clinton, but she has not done or said anything that could even be misconstrued as an endorsement. Some Clinton surrogates have even steered clear of Maryland to avoid unhelpful attention.

But the former secretary of state’s efforts to win Maryland may have the unintended consequences of helping to mobilize Edwards’ voters, since both are counting on strong showings from black women.

Close video Clinton maintains strong lead in Pennsylvania Hillary Clinton is leading rival Bernie Sanders in Pennsylvania, according to a new Monmouth University poll. Clinton was also in Philadelphia Wednesday looking ahead to next week’s contests. Hillary Clinton is leading rival Bernie Sanders in Pennsylvania, according to a new Monmouth University poll. Clinton was also in Philadelphia Wednesday looking ahead to next week’s contests. share tweet email Embed

“It’s definitely going to work in her favor, but not so overwhelmingly that large turnout will be too destructive,” said Glendening, who supports Van Hollen. “On the other hand, the Sanders campaign tends to turnout the millennials. They naturally are gravitating towards Chris Van Hollen.”

Polling is limited, but it suggests young people are actually breaking for Edwards.

It’s the first year in recent memory that the Senate primary has fallen on the same day as the presidential primary – and a rare year when Maryland’s presidential primary actually matters, noted Kevin Walling, a Maryland Democratic strategist, raising the stakes even higher.

Meanwhile, in Pennsylvania, virtually every major Democratic interest group, along with President Obama and Vice President Biden, have lined up behind Katie McGinty, a former state official. But she’s trailing Joe Sestak, a former admiral and congressman.

Pro-McGinty forces have grumbled that Clinton has decided to sit this one out, especially since it’s so close that any little thing might be enough to put McGinty over the top. And unlike Maryland, the party is more or less united in its pick.

But Pennsylvania Sen. Bob Casey, who is backing Clinton, said he gets why Clinton is staying out. “Both Joe and Katie served in the Clinton Administration, so they both have relationships there,” he said. “When you’re running for president, you kind of have to focus on your race and diving into a primary is complicated.”

McGinty was a top environmental adviser to the Clinton White House while Sestak was a top defense adviser. The Clintons have long ties to Sestak, who in 2008 served as a surrogate for Clinton’s presidential campaign.

RELATED: Clinton holds strong lead in PA, new poll shows

Meanwhile, there’s a third candidate in the race. Braddock Mayor John Fetterman is an unapologetic lefty who looks like a the bouncer at a biker bar, despite his graduate degree from Harvard’s Kennedy School of Government.

Fetterman has endorsed Sanders and is hoping to ride the candidate’s political revolution to the Senate, but Sanders has done nothing to return the favor.

“I’m sitting here with my corsage, waiting,” Fetterman told Slate of Sanders’ absence.

That’s led friends and foes alike to criticize Sanders for failing to deliver on his promise to help sweep into office a wave of like minded politicians.

It may be outside his control. Top Senate Democrats warned Sanders not to get involved in the race, according to multiple sources familiar the matter.

As with Maryland, the presidential primary is expected to boost turnout in Pennsylvania, but it’s unclear what impact that would have on the Senate race. “I’m not positive who that helps. My sense it that probably helps Katie,” said Casey, who supports McGinty.

As one unnamed McGinty official put it to Roll Call, “People who give a s— about a woman being president also give a s— about a woman being a senator.”

Competitive primaries are unusual for Democrats, whose party leaders tend to work hard behind the scenes to clear the field for their favored candidate, in part to avoid just such awkward entanglements.

The candidates faced a similar issue in Florida, where liberal Rep. Alan Grayson is facing off against party favorite Patrick Murphy, but the primary isn’t held until later this summer. Other primaries, like California’s, have become less contentious than originally expected.

But Clinton and Sanders won’t have to deal with them much longer.