(CNN) Republican and Democratic Senate leaders reached a broad deal Thursday to confirm a package of 15 judges that will allow the senators to depart Washington until after Election Day.

Senate Majority Leader Mitch McConnell made the agreement public when he announced votes on three circuit court judges and 12 district court judges.

The deal is a significant victory for McConnell, who has made clearing a long list of President Donald Trump's nominees, especially judges, a top priority this year.

It is also a boon for senators seeking re-election, especially those 10 Democrats running in states won by Trump in 2016, because they will be free finally to leave DC and focus more fully for the next month on their campaigns.

Republican leaders made clear throughout the year they had no qualms about keeping senators in Washington until very close to Election Day. That's because the GOP is defending only eight Senate seats in November, only two of which are somewhat close.

But Democrats are defending 25 seats, so being back home is more consequential for them. Polls show that most of the red state Democrats are in competitive races.

Sen. Heidi Heitkamp was back in North Dakota before the deal was reached. She may be the most vulnerable Democrats running. She voted Wednesday on a health care bill that was a top priority for Democrats but wasn't around for votes later Wednesday or Thursday on Trump nominees.

Asked about Heitkamp missing votes to campaign, her spokeswoman Abigail McDonough took a shot at the House, where her GOP opponent, Rep. Kevin Cramer, serves.

"Senator Heitkamp is back in North Dakota meeting with workers and families across her state," McDonough said. "Unfortunately, the House has only been in session for 10 days since the beginning of August, while the Senate has been working hard -- a telling statistic about the politics and work ethic in the House this year."

As he walked on the Senate floor before the deal was announced, Democratic Sen. Jon Tester of Montana, a state Trump won by more than 20 points, was asked if he thought McConnell was playing hardball with the nominations to keep him in DC.

He laughed loudly and said the answer was so obvious that even political reporters could determine on their own that it was true.

"Honest to God, I would answer that question, but I'm going to let you guys do that assessment," he said.

Sen. John Cornyn of Texas, the second-ranking GOP leader, said McConnell had offered Senate Minority Leader Chuck Schumer "a list of nominations that are not particularly controversial, and if they will agree to dispose of them, then they'll be able to go back home" to "raise money and campaign."

But Sen. Dick Durbin, the No. 2 Democrat, said some of the nominees "are clearly controversial," meaning Democratic leaders had to balance their desire to get their candidates home with essentially allowing judges they oppose to advance.

Democratic leaders also recognized the risk that a deal that put more conservatives on the bench could anger and dispirit their base voters.

Sen. Mazie Hirono, a Hawaii Democrat who become a hero to many progressives for her handling of the contentious Brett Kavanaugh Supreme Court confirmation, said she wanted Schumer to cut a deal and get people home.

"Elections matter and I would like my colleagues to be able to go home," she said. "Every day that goes by when they're not touching base with their constituents is not a good thing"

Hirono said she was not concerned about a backlash from Democratic voters if the deal appears favorable to Republicans.

"I hope that our supporters understand that, but we need to be focusing on is the outcome of the 2018 elections," she said adding that if Democrats control the Senate next year they will be able to block Trump's nominees they oppose. "Right now, we do not have those votes and I think they understand that."

Sen. Joe Manchin, a Democrat running in West Virginia, which Trump won by 46 points, said he expected McConnell would demand a lot in return for letting Democrats go.

"Mitch is going to do what Mitch is going to do," he said. "I don't think you can make any deal with Mitch if he thinks he's going to get you."

He also acknowledged he'd like to get home.

"It's always a good thing if we can be home campaigning," Manchin said. "We need to do that."

Republican Sen. John Kennedy agreed that McConnell was dead set on getting a good deal for Republicans.

"He is mad as a mama wasp and he is determined to get the nominations through, and I don't think he's bluffing," Kennedy said.