The U.S. Senate has scheduled a vote for Thursday morning on the nomination of Loretta Lynch to be the next attorney general, ending a month-long partisan impasse on an unrelated human trafficking bill that threatened to stall her confirmation indefinitely.

The Thursday vote on Lynch was set late on Tuesday following hours of negotiations between Republicans and Democrats. Lynch, an accomplished career prosecutor, was nominated by President Barack Obama in November.

The Senate also agreed to set a path for likely passage on Wednesday of the bill aimed at cracking down on human trafficking, a measure that Senate Majority Leader Mitch McConnell insisted had to be completed before the Lynch vote could take place.

Lynch, 55, would be the first black woman to become the country's top law enforcement official. She is expected to be confirmed in the Senate by a narrow margin.

Democrats had held up passage of the bipartisan trafficking bill because of anti-abortion language Republicans inserted into the measure.

McConnell retaliated by not allowing a Senate vote on Lynch, who would replace Attorney General Eric Holder, until the trafficking bill passed the Senate.

Abortion measure in bill

The compromise on the bill would apply abortion restrictions only to funds appropriated by Congress for health care and medical services for victims and would not apply to funds used for victims' aid not related to healthcare, such as legal aid and law enforcement, according to a Senate Republican aide who spoke on condition of anonymity.

Lynch has faced a protracted process since her nomination. Her wait for approval has been longer than the last seven attorney generals combined.

Despite the delay, she is viewed as less controversial than Holder, who frequently clashed with Republicans. She has said she aims to smooth the Department of Justice's ties with Congress.

That may prove tricky. Many Senate Republicans have already said they will vote against her to protest her support for an executive order by the Obama administration that would shield an estimated 4.7 million illegal immigrants from deportation.

Lynch has twice served as U.S. attorney in Brooklyn, most recently since 2010.