In this Jan. 28, 2015 file photo, Attorney General nominee Loretta Lynch testifies on Capitol Hill in Washington.

WASHINGTON — President Barack Obama on Friday said it was “crazy” and “embarrassing” the way the Republican-led Senate has held up confirmation of his attorney general nominee, Loretta Lynch.

“What are we doing here?” Obama said. “I have to say there are times when the dysfunction in the Senate just goes too far. This is an example of it. It’s gone too far. Enough. Enough.

“Call Loretta Lynch for a vote,” he said emphatically. “Get her confirmed.”

Lynch is the U.S. attorney for New York’s Eastern District and would succeed Attorney General Eric Holder if confirmed. She would become the first black woman to serve as the nation’s top law officer.

Dozens of Senate Republicans have opposed her for various reasons, chiefly her support of Obama’s immigration policies.

Her vote has been put off because Senate Majority Leader Mitch McConnell has first wanted a Senate vote on a bipartisan sexual-trafficking bill that has been held up over a dispute about abortion. McConnell on Wednesday said Sen. John Cornyn, R-Texas, has adjusted the language to mirror that contained in bipartisan Medicare legislation that the Senate approved Tuesday.

McConnell said he was “hopeful” that the obstacle to bringing Lynch to the Senate floor would be addressed next week, clearing the way for her confirmation vote.

But an aide to Minority Leader Harry Reid said no deal was yet in hand and echoed Obama’s call. Obama spoke at a news conference alongside visiting Italian Prime Minister Matteo Renzi.