After weeks of negotiations over a bill to help victims of sex trafficking, U.S. Senate leaders announced Tuesday morning that lawmakers finally reached an agreement, paving the way for attorney general nominee Loretta Lynch to get a confirmation vote in the next few days.

"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, reported The New York Times. "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."

The deadlock was broken after both parties were able to agree to language in the anti-trafficking bill that largely prevents a victims' fund established by the legislation from being used for health care or medical services, including abortions.

Because of abortion restrictions, the bill was filibustered by Democrats since it arrived on the Senate floor in February, but Republicans refused to proceed with Lynch's confirmation until an agreement was reached.

Under the new compromised bill, the trafficking victim fund will be separated in two. The money collected from criminal offenders would be deposited into one account and used for non-health care services, which will not be subject to abortion. The other half would be funded by money already appropriated by Congress for Community Health Centers and could be used for health care and medical services, where it would be subject to longstanding abortion restrictions known as the Hyde Amendment, which provides exemptions in the case of rape and incest, according to The Washington Post.

The bill is expected to go up for final passage vote late Tuesday or Wednesday after the Senate finishes taking up amendments, and lawmakers will then move on to Lynch's confirmation.

It's been five months since Lynch was nominated by Obama, who pointed out that Lynch "has been now sitting there longer than the previous seven attorney general nominees combined."

Being that 51 senators have publicly voiced their support for Lynch, including at least five Republicans, she's expected to be confirmed without much trouble, though since not all senators are likely to agree to move forward with her nomination, a procedural vote could first be required, which would push her confirmation until Thursday or as late as next week.