The long-awaited confirmation vote on the nomination of Loretta Lynch for attorney general has been set for Thursday after Senate leaders reached a deal on an unrelated anti-human trafficking bill.

Senate Majority Leader Mitch McConnell, R-Ky., filed cloture on the Lynch nomination late Tuesday, setting up a test vote for Thursday morning. McConnell had held off a vote on Lynch's nomination until an impasse over language concerning abortion in the anti-trafficking measure.

If Lynch clears the test vote, the Senate will move on to a final confirmation.

Though Lynch faces heavy Republican opposition in her bid to succeed Eric Holder at the helm of the Justice Department, she may have just enough support to clear the 60-vote threshold and secure confirmation from the Senate. Although her record is widely praised, a number of Republicans have said they can't support her because of her backing for Obama's executive moves on immigration.

Lynch, who would become the nation's first black female attorney general, replacing Eric Holder, is now the U.S. attorney for the Eastern District of New York. She has been waiting 164 days for a vote, far longer than most other recent attorney general nominees.

The new human-trafficking deal aims to address Democratic concerns that the legislation would expand existing prohibitions on spending federal funds for abortions. The legislation envisions a new victims' fund made up of fees paid by sex criminals, and Democrats said that applying abortion spending prohibitions to that new source of non-taxpayer funds was an expansion they could not accept.

Republicans in turn said they had to be satisfied that existing abortion spending prohibitions would not be curtailed.

The final language, negotiated by Senate Minority Leader Harry Reid, D-Nev., and Sens. John Cornyn, R-Texas, and Patty Murray, D-Wash., would resolve that issue by establishing two sources of money for the new victims' fund. Money collected from the fines assessed on criminal perpetrators would be used for services such as legal aid, but not for health or medical services, and therefore language on abortion would not be relevant. Money already appropriated by Congress for Community Health Centers — and already subject to abortion spending restrictions -- would be available for health and medical services.

Obama spokesman Josh Earnest said the White House was reserving judgment until it had a chance to review the final language in the deal, but he also said the endorsement from some Democrats was "certainly an encouraging sign."

"If we see strong Democratic support, including from champions for women's health care like Patty Murray, that certainly seems like the kind of thing the president would be able to support," Earnest said.

Fox News' Kara Rowland and The Associated Press contributed to this report.