WASHINGTON -- Vowing "I will not be bullied," President Donald Trump's nominee for attorney general asserted independence from the White House, saying he believed that Russia had tried to interfere in the 2016 presidential election, that the special counsel investigation shadowing Trump is not a witch hunt and that his predecessor was right to recuse himself from the probe.

The comments by William Barr at his Senate confirmation hearing Tuesday pointedly departed from Trump's own views and underscored Barr's efforts to reassure Democrats that he will not be a loyalist to a president who has appeared to demand it from law enforcement. He also repeatedly sought to assuage concerns that he might disturb or upend special counsel Robert Mueller's investigation as it reaches its final stages.

Some Democrats are concerned about that very possibility, citing a memo Barr wrote to the Justice Department before his nomination in which he criticized Mueller's investigation for the way it was presumably looking into whether Trump had obstructed justice.

Sen. Dianne Feinstein of California, top Democrat on the Senate Judiciary Committee, told Barr the memo showed "a determined effort, I thought, to undermine Bob Mueller." The nominee told senators he was merely trying to advise Justice Department officials against "stretching the statute beyond what was intended" to conclude the president had obstructed justice.

Though Barr said an attorney general should work in concert with an administration's policy goals, he broke from some Trump talking points, including the mantra that the Russia probe is a witch hunt, and said he frowned on "Lock Her Up" calls for Hillary Clinton. Trump has equivocated on Russian meddling in the 2016 election and assailed and pushed out his first attorney general, Jeff Sessions, for recusing because of his work with the Trump campaign.

Barr stated without hesitation that it was in the public interest for Mueller to finish his investigation into whether the Trump campaign co-ordinated with the Kremlin to sway the presidential election. He said he would resist any order by Trump to fire Mueller without cause and called it "unimaginable" that Mueller would do anything to require his termination.

"I believe the Russians interfered or attempted to interfere with the election, and I think we have to get to the bottom of it," Barr said during the nine-hour hearing.

He said that, at 68 years old and partially retired, he felt emboldened to "do the right thing and not really care about the consequences." If a president directs an attorney general to do something illegal, he said, an attorney general must resign.

"I will not be bullied into doing anything that I think is wrong by anybody, whether it be editorial boards or Congress or the president," Barr said.

Consumed by the partial government shutdown, Trump remained out of sight at the White House but also kept an eye on the news coverage of the hearing and told aides he was pleased with how Barr was handling himself, said two White House officials and a Republican close to the White House who spoke on condition of anonymity because they were not authorized to discuss internal conversations.

On other topics, Barr echoed in part Trump's hardline immigration stance and said the Justice Department would not go after marijuana companies in states where the drug is legal. He also would not rule out jailing reporters for doing their jobs, saying he could envision circumstances where a journalist could be held in contempt "as a last resort."

Barr's hearing continues Wednesday with a lineup of character witnesses, including former Attorney General Michael Mukasey.

Barr's confirmation is likely, given that Republicans control the Senate. Even some Democrats have been looking to move on from acting Attorney General Matthew Whitaker, who declined to remove himself the Russia probe and has faced scrutiny over his private dealings.

But he nonetheless faced skeptical questions from Democrats over whether he could oversee without bias or interference the remainder of Mueller's probe.

Feinstein said the nominee's past rhetoric in support of expansive presidential powers "raises a number of serious questions about your views on executive authority and whether the president is, in fact, above the law." Barr, responding with a more moderate view, said he believed a president who ordered an attorney general to halt an investigation would be committing an "abuse of power" if not necessarily a crime.

Barr said under questioning from Sen. Chris Coons, a Delaware Democrat, that he wouldn't interfere with a Mueller request to subpoena Trump for his testimony "if there was a factual basis." But he also said he saw no reason to change Justice Department legal opinions that have held that a sitting president cannot be indicted.

Barr called Mueller a friend of 30 years and said "it is vitally important" that Mueller be allowed to complete his investigation.

"I don't believe Mr. Mueller would be involved in a witch hunt," he said when asked by the panel's Republican chairman, Sen. Lindsey Graham of South Carolina.

The special counsel is required to report his findings confidentially to the Justice Department. Barr said he then expected to produce his own report to Congress and said it was his goal to release as much information as possible to the public, though he stopped short of a direct pledge. He also noted the Justice Department does not typically disclose information about people it decides not to prosecute.

He disclosed having discussed Mueller with Trump during a meeting in 2017 when Barr declined to join his legal team. He said he and his wife had been "sort of looking forward to a bit of respite and I didn't want to stick my head into that meat grinder."

Trump wanted to know what Mueller, who worked for Barr when he led the Justice Department between 1991 and 1993, was like.

"He was interested in that, wanted to know what I thought about Mueller's integrity and so forth and so on," Barr said. "I said Bob is a straight shooter and should be dealt with as such."

He also defended his decision to send an unsolicited memo to the Justice Department in which he criticized as "fatally misconceived" the theory of obstruction that Mueller appeared to be pursuing with regard to Trump, including investigation into his president's firing of former FBI director James Comey.

He said he raised his concerns at a lunch with the deputy attorney general, Rod Rosenstein, who appointed Mueller. Rosenstein didn't respond and was "sphinx-like," Barr recalled. He followed up with the memo in June. Barr sent the document to White House lawyers and discussed it with Trump's personal attorneys and a lawyer representing Trump's son-in-law, Jared Kushner, among others.

Barr said the memo was narrowly focused on a single theory of obstruction that media reports suggested Mueller might be considering.

He said he would consult with ethics officials on whether he would need to recuse because of the memo but the decision would be ultimately his.

------

Associated Press writers Chad Day, Jonathan Lemire and Colleen Long contributed to this report.