The US Senate has confirmed Loretta Lynch as the nation's first black female attorney general, the country's highest law enforcement post.

Lynch, 55, was confirmed in a 56-43 vote, following weeks of gridlock after her confirmation process was dragged into a partisan battle over abortion.

The vote total for Lynch, the US Attorney for the Eastern District of New York, was the lowest for any attorney general since Michael Mukasey won confirmation with 53 votes in 2007 after Democrats decried his refusal to describe waterboarding as torture. 

Lynch replaces outgoing Eric Holder, whom Republicans had criticised as being a rubber stamp for Obama policies.

A statement released by Holder after Lynch's confirmation said she had "earned trust" from allies and foes, the AP news agency reported.

"Loretta Lynch is a gifted attorney, a consummate professional, and a dedicated public servant," Holder said.

"I am pleased that the United States Senate has recognized her clear qualifications and the need for her confirmation as Attorney General of the United States.

"At every stage of her career, Loretta has earned the trust and high regard of allies and adversaries alike, both in Washington and throughout the country.

"She is respected by law enforcement officers, civil rights leaders, and criminal justice officials of all political stripes.

"In every case and every circumstance, she has demonstrated an unfailing commitment to the rule of law and a steadfast fidelity to the pursuit to justice."

Holder said he had worked closely with Loretta for many years and knew she would continue the vital work that Obama's administration has set in motion.

Lynch, who grew up in the state of North Carolina, has been the top prosecutor since 2010 for a district that includes Brooklyn, Queens, Staten Island and Long Island, a role she also held from 1999 to 2001.

Source: Al Jazeera and agencies