Hillary Clinton and Bernie Sanders debate face to face Thursday night for the first time in five weeks, a showdown that comes at a pivotal moment in their increasingly contentious fight for the Democratic presidential nomination.

Clinton is eyeing a victory in her adopted home state of New York’s primary next week, aiming to blunt Sanders’ recent momentum and put his pursuit of the nomination further out of reach. A Sanders upset over Clinton would shake up the race, raising fresh concerns about her candidacy and breathing new life into the Vermont senator’s campaign.

Against the backdrop of those high stakes, the contest between Clinton and Sanders has taken a bitter turn. Just getting the candidates to agree on the terms for this debate turned into a major effort, with each side accusing the other of trying to manipulate the process. They finally settled on the 9 p.m. EDT faceoff in Brooklyn, where Sanders was born and Clinton has her campaign headquarters.

Sanders recently angered the Clinton campaign when he suggested she was unqualified to be president, an assertion he later walked back. While Clinton didn’t explicitly call Sanders unqualified, she has raised questions about the depth of his policy expertise.

During an appearance Thursday, Sanders tried to lower the tensions, saying he respects Clinton and believes she is "an extremely intelligent woman with a wonderful resume and a whole lot of experience." Still, his campaign announced a new TV ad for New York, taking an obvious shot at Clinton.

"Nothing will change until we elect candidates who reject Wall Street money," the narrator says.

Sanders has won a string of recent primary contests, including a big victory earlier this month in Wisconsin. But because Democrats award their delegates proportionally, he’s struggled to cut into the lead Clinton took earlier in the voting. He’s also failed to persuade superdelegates — the party insiders who can back the candidate of their choice regardless of how their states vote — to switch their loyalties from Clinton.

Clinton has accumulated 1,289 pledged delegates from primaries and caucuses while Sanders has 1,038. Her lead grows significantly when the superdelegates are added in: 1,758 for Clinton and 1,069 for Sanders.

It takes 2,383 to clinch the Democratic nomination. Sanders would need to win 68 percent of the remaining delegates and uncommitted superdelegates to reach that figure.

Despite his long mathematical odds, Sanders has vowed to stay in the race through the party’s convention in July. Backed by legions of loyal supporters, he’s amassed impressive fundraising totals that give him the financial wherewithal to do just that.

Still, there have been signs in New York that Clinton is starting to turn her eye toward the general election. She’s run two ads in the state targeting GOP front-runner Donald Trump, a native New Yorker, and his policies on immigration.

And with Trump facing the prospect of a contested convention fight with rival Ted Cruz, Clinton has begun focusing on the Texas senator as well.

"I’m really looking forward to debating either Donald Trump or Ted Cruz," Clinton during a campaign stop in Rochester last week. "I mean, it’s going to be good."

(Copyright (c) 2016 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox