Attorney General Jeff Sessions repeatedly insisted Wednesday that his private talks with President Trump were off-limits to lawmakers — infuriating Democrats who for months have sought details of how the FBI director was fired amid a probe into Russia's election interference.

During a contentious five-hour oversight hearing before the Senate Judiciary Committee, Democratic senators peppered the nation's top law enforcement officer with questions on former FBI director James B. Comey, Trump and the ongoing investigation into possible coordination between the Trump campaign and Russia during the 2016 presidential race. But for the most part, Sessions declined to offer any new details about those matters.

He would not say what Trump told him before Comey's firing, offering only that the president asked for his advice in writing. He said he has not been interviewed by special counsel Robert S. Mueller III, who is leading the probe that is exploring, in part, whether Trump obstructed justice leading up to Comey's removal.

Sessions lambasted the former FBI director, saying he did not believe "it's been fully understood the significance of the error that Mr. Comey made" concerning the investigation of Hillary Clinton's use of a private email server. But he would not say whether the president, in deciding to remove Comey, mentioned the Russia case in their discussions. He also would not say if he was aware of a draft letter detailing reasons that Comey should be removed.

At one point, Sen. Amy Klobuchar (D-Minn.) asked Sessions if he could commit to not putting reporters in jail for doing their jobs, a reference to the president's attacks against the media and the many leak investigations the Justice Department is conducting.

"I don't know that I can make a blanket commitment to that effect, but I would say this: We have not taken any aggressive action against the media at this point," Sessions said. He added: "We always try to find an alternative way, as you probably know, Senator Klobuchar, to directly confronting a media person, but that's not a total blanket protection."

The oversight hearing marked the first time Sessions has appeared before the Judiciary Committee since his confirmation hearing in January. Lawmakers pressed the attorney general on a variety of topics — including his legal opinion on the travel ban, the DACA program for illegal immigrants who came to the United States as children and his threat to strip "sanctuary cities" of federal grants. But as with many political affairs in Washington in 2017, much of the hearing was spent talking about Russia.

Sessions recused himself from the Russia case because of his role on the Trump campaign, though he could be someone with whom Mueller wants to speak. He said he would be willing to cooperate with the probe and that he has not been asked for an interview.

Of his personal confidence in Mueller, Sessions said: "I think he will produce the work in a way he thinks is correct, and history will judge." He said he was not involved in the case even before his recusal and that he did not know if it would be "appropriate" for Trump to pardon people who were under investigation by Mueller. But he added that the "pardon power is quite broad."

Democrats, in particular, have long been interested in Sessions's own meetings with Russians, after The Washington Post reported in March that he had spoken twice last year with Sergey Kislyak, then Russia's ambassador to the United States, and did not disclose the encounters when asked during his confirmation hearing to become attorney general about possible contacts between members of Trump's campaign and representatives of Moscow.

Sessions offered a slightly new wrinkle Wednesday, asserting that he may have discussed Trump campaign policy positions in his 2016 conversations with Kislyak. The attorney general said it was "possible" that "some comment was made about what Trump's positions were," though he also said, "I don't think there was any discussion about the details of the campaign."

The Post reported in July that Kislyak reported back to his superiors in the Kremlin that the two had discussed campaign-related matters, including policy issues important to Moscow. Sessions has previously said he did not "recall any specific political discussions," though he allowed that most ambassadors are "pretty gossipy" and that it was "campaign season" when he and Kislyak talked.

In one of the testiest exchanges of the hearing, Sen. Al Franken (D-Minn.), who had asked Sessions about the Trump campaign and Russia contacts at the confirmation hearing, accused the attorney general of changing his story over time.

While Sessions first asserted that he "did not have communications with the Russians," he now seemed to only be denying that he had inappropriate discussions about election interference, Franken said.

Sessions shot back that Franken's question came with a "very, very troubling" lead-up and that he answered "in a way that I felt was responsive to what you raised in your question." The two men interrupted each other, and, at one point, Sessions erupted. "Mr. Chairman, I don't have to sit in here and listen to his charges without having a chance to respond," he said. "Give me a break."

Democrats had warned Sessions that they expected him to answer questions about his conversations with Trump, especially as they might relate to the firing of Comey and the Russia investigation. Sessions, though, said in his opening remarks that he would not. Nor would he honor Democrats' request that he detail the particular topics on which Trump would assert executive privilege and block his testimony, he said.

"I can neither assert executive privilege nor can I disclose today the content of my confidential conversations with the president," Sessions said.

At a Senate Intelligence Committee hearing in June, Sessions also refused to detail his conversations with the president. But Democrats have questioned his rationale for not providing at least some information. In a letter to Sessions last week, they said the attorney general needed to formally identify the topics over which Trump would assert executive privilege — and Sessions thus could not address — and fully answer questions about the others.

[Jeff Sessions testifies: Refuses to say whether he spoke to Trump about Comey’s handling of Russia investigation]

"We expect that when you appear before the Senate Judiciary Committee on October 18th, you will have determined whether the president will invoke executive privilege as to specific topics and will be prepared to answer completely all questions in those areas on which he has not," the Democrats wrote. "As to the former category, we will expect you to provide the Committee with a list of issues over which the privilege has affirmatively been asserted."

Sessions also used the hearing to defend Trump's travel ban, saying it could help prevent terrorist attacks in the United States. He called the directive — which was blocked by two federal judges Tuesday and Wednesday — an "important step" in the fight against terror.

"It's a lawful, necessary order that we are proud to defend," Sessions said, adding, "We are confident we'll prevail, as time goes by, in the Supreme Court."

He said military leaders had told him to expect an "increase in attacks" as the Islamic State is pushed out of strongholds in Syria and Iraq.

Sessions sparred with Sen. Richard J. Durbin (D-Ill.) over his attempts to withhold federal grant money from Chicago over the city's "sanctuary" policies. A federal court recently blocked Sessions from doing so, and Durbin said the attorney general was wrong to harp on the city's rise in violent crime while also trying to take resources.

"You want to cut off federal funds to that city, and come here and criticize the murder rate. You can't have it both ways," Durbin said.

Sessions shot back that federal authorities "can't take over law enforcement for the city of Chicago" and that they needed city officials to notify them when illegal immigrants were scheduled to be released from jail.