U.S. President Barack Obama (L) introduce Loretta Lynch (R) as his nominee to replace Eric Holder as Attorney General during a ceremony in the Roosevelt Room of the White House November 8, 2014 in Washington, DC.

U.S. President Barack Obama (L) introduce Loretta Lynch (R) as his nominee to replace Eric Holder as Attorney General during a ceremony in the Roosevelt Room of the White House November 8, 2014 in Washington, DC.

*Congress has at last compromised on something.

After weeks of negotiations, the Senate on Tuesday reached an agreement on a bill to help victims of sex trafficking, finally paving the way for a confirmation vote on Loretta E. Lynch to replace Eric H. Holder Jr. as attorney general.

Disagreement over a provision that would ban criminal fines put into a victims’ fund from being used to pay for abortions created a broader stalemate in the Senate as Senator Mitch McConnell of Kentucky, the majority leader, said he would not schedule a vote on Ms. Lynch’s nomination until the Senate passed the trafficking bill.

Other matters, such as a measure that would give Congress a voice in the nuclear negotiations between Western nations and Iran has also been on hold until the sex trafficking bill was passed.

“I’m thrilled we were finally able to come together to break the impasse over this vital legislation,” said Senator John Cornyn, Republican of Texas, the main sponsor of the bill. “I look forward to swift passage in the Senate so we can ensure victims of human trafficking receive the resources they need to restore their lives.”

A vote on the sex-trafficking bill was expected as early as Tuesday afternoon.

It has been about five months since President Obama nominated Lynch to succeed Holder, meaning she has waited longer than any other cabinet secretary nominee in the past three administrations. With the stated support of at least five Republicans, she is expected to be confirmed.