WASHINGTON (AP) — U.S. attorney general nominee Loretta Lynch, confronting skeptical Republicans, pledged a new start with Congress and independence from President Barack Obama Wednesday, even as she defended the president's unilateral protections for millions of immigrants in the U.S. illegally.

"If confirmed as attorney general, I would be myself. I would be Loretta Lynch," the nominee told her Senate confirmation hearing as Republicans showered criticism on the current occupant of the job, Eric Holder. They said Holder was contemptuous of Congress and too politically close to Obama, and repeatedly demanded assurances that Lynch would do things differently.

"You're not Eric Holder, are you?" Texas Republican John Cornyn, one of the current attorney general's most persistent critics, asked at one point.

"No, I'm not, Sir," Lynch responded with a smile.

It was a moment that summed up a Senate Judiciary Committee hearing that was often more about Obama and Holder than about Lynch, who is now the top federal prosecutor for parts of New York City and Long Island. If confirmed, she would become the nation's first black female attorney general.

Holder, Cornyn contended, "operated as a politician using the awesome power conferred by our laws on the attorney general." Lynch asked the senator to take note of "the independence that I've always brought to every particular matter," and she said that when merited she would say no to Obama.

The hearing was the first such proceeding since Republicans retook control of the Senate in January. Lynch is expected to win confirmation without difficulty in the end, in part because Republicans are so eager to be rid of Holder. He has been a lightning rod for conservatives over the past six years, clashing continually with lawmakers and becoming the first sitting attorney general to be held in contempt of Congress.

On immigration, Lynch faced numerous questions from Republicans critical of the administration's new policy granting work permits and temporary deportation relief to some 4 million people who are in the U.S. illegally. The committee chairman, Republican Chuck Grassley, called the effort "a dangerous abuse of executive authority."

Lynch said she had no involvement in drafting the measures but called them "a reasonable way to marshal limited resources to deal with the problem" of illegal immigration. She said the Homeland Security Department was focusing on removals of "the most dangerous of the undocumented immigrants among us."

Lynch found occasions to differentiate herself from Holder but without contradicting him.

She stated without hesitation under questioning from Sen. Lindsey Graham that she considers the death penalty an effective punishment and has sometimes sought it in her district. That was a rhetorical shift from Holder, who has expressed personal reservations about the punishment, particularly in light of recent botched executions, but who has also sought it in past cases.

On another controversial topic, Lynch said that current National Security Agency intelligence-gathering programs are "constitutional and effective." She said she hopes Congress will renew three expiring provisions in the Foreign Intelligence Surveillance Act, which allows the FBI to obtain search warrants and communications intercepts in intelligence cases.

Beyond his clashes with Congress, Holder has faced accusations from critics that he has aligned himself more with protesters alleging police violence than with members of law enforcement, a contention he and the Justice Department have strongly denied.

It's an area Lynch is familiar with. She helped prosecute New York City police officers who beat and sexually assaulted Haitian immigrant Abner Louima in 1997, and her office in New York is currently leading a civil rights investigation into the police chokehold death of Eric Garner in New York last summer.

Lynch told senators that one of the most important issues facing the country is "the need to resolve the tensions that appear to be discussed and appear to be rising between law enforcement and the communities that we serve." She said the best way to deal with the problem is to get all parties "to meet and talk."