WASHINGTON — Attorney General Jeff Sessions opened his testimony before the Senate Select Committee on Intelligence on Tuesday by denying he had ever met with Russian officials in an attempt to influence the outcome of the 2016 presidential election.

Sessions called it an “appalling and detestable lie” that he would ever have tried to collude with a foreign power.

“Did you hear any whisper, any suggestion … by anyone in that campaign that somehow the Russians were involved?” Sen. James Risch, R-Idaho, asked later.

Sessions said he had not.

Sen. Tom Cotton, R-Ark., was more to the point, ridiculing the very idea that Sessions would have met with a Russian official to pull off a “caper.”

Cotton asked Sessions if he read spy novels, then offered: “Ever hear of a plot line so ridiculous?”

“Thank you for saying that,” Sessions responded. “It’s through the looking glass.”

Live on Twitter: @lynnsweet covering the Senate hearing

Sessions became angry during questioning by Sen. Ron Wyden, D-Oregon., who accused Sessions of “stonewalling” by not answering questions about conversations with President Donald Trump about the Russia investigation.

It was a point picked up on by Sen. Martin Heinrich, D-N.M., who flat-out accused Sessions of violating the oath he had just taken.

Heinrich pointed out that Sessions had not claimed the conversations with Trump were classified and therefore should be shared in closed session. And he had not invoked executive privilege — because he could not.

There is no legal justification to decline to answer the question based on his feeling that it would not be “appropriate,” Heinrich said.

“You are impeding the investigation,” Heinrich said.

Even if Trump has not asserted executive privilege, “I am protecting the right of the president to assert it,” Sessions later explained to Sen. Angus King, I-Maine. “It would be premature” to deny the president that opportunity, Sessions said.

Sen. Dianne Feinstein, D-Calif., focused on how Sessions was involved in the firing of FBI Director James Comey.

“We had problems there, and it was my judgment that a fresh start at the FBI was the best thing to do.”

His handling of the Hillary Clinton email investigation, he said, “caused controversy on both sides of the aisle.”

The hearing with Sessions, who had recused himself from the FBI probe into whether Russia interfered with the 2016 election is taking place in the Hart Senate Office Building.

Sessions also had bristled when Sen. Wyden asked him about that recusal.

Comey last week had testified that he knew of reasons why it would be problematic for Sessions to remain involved in the Russia investigation, even before he recused himself.

Sessions insisted there were no such reasons, and complained about “innuendo” that he had not been honest.

Committee Chairman Richard Burr, R-N.C., opened the hearing by saying that while the committee often meets in private, the need for a public hearing in this instance was obvious, given “the need of the American people to have the facts, so that they might make their own judgments.”

Burr said he hoped the hearing would “separate fact from fiction, and to set the record straight on a number of allegations. … Only then will we as a nation be able to put this episode to rest, and look to the future.”

He added that he wanted committee members to focus on that goal, and “not squander the opportunity to take political or partisan shots.”

Committee Vice Chairman Mark Warner, D-Va., took a harsher tone — noting, for instance, that Sessions had recused himself from matters related to the Russia investigation, but later participated in the firing of Comey over what Trump later said was his handling of that matter.

Warner also wondered why Trump has not been as worried about election tampering as other elected officials.

“The threat we face is real,” Warner said. “All western democracies must take steps to protect themselves.”

RELATED: Trump allies turn on Mueller

Warner tried to pin down Sessions on reports that Trump was thinking about firing special counsel Robert Mueller, the former FBI director who has been appointed special counsel to investigate the Russia matter.

Warner and Sessions talked over each other several times.

“I have confidence in Mr. Mueller but I’m going to discuss any hypotheticals,” but in response to another question, he said that given his recusal, it would not be appropriate for him to play a role in deciding whether Mueller should be fired.

When Comey appeared before the panel on June 8, he said he believed he was fired by Trump because he would not shut down the Russia probe and to suggest it was for his performance were “lies, plain and simple.”

Trump said on Tuesday, “The Fake News Media has never been so wrong or so dirty. Purposely incorrect stories and phony sources to meet their agenda of hate. Sad!” via a 5:35 a.m. Eastern Time Twitter post.

Sessions recused himself in March from a federal investigation into contacts between Russia and the presidential campaign of Donald Trump after acknowledging that he had met twice last year with the Russian ambassador to the United States. He had told lawmakers at his January confirmation hearing that he had not met with Russians during the campaign.

‘I recused myself because of any asserted wrongdoing” but because of Department of Justice regulations, which state that he should not be involved because he had worked on the campaign.

“It is absurd” that recusing himself from one specific investigation would render him unable to play a role in deciding who would run the FBI or any government agency under his purview, Sessions told senators on Tuesday.

Though he recused himself from the Russia probe, “I did not recuse myself from defending my honor from unfair and scurrilous allegations,” Sessions said.

He also said he had shared some of the concerns about Comey’s job performance as had been laid out in a memo prepared by Deputy Attorney General Rod Rosenstein shortly before Comey was fired — and cited as the impetus for the firing by the administration. That argument, however, was undercut by Trump himself when he told NBC’s Lester Holt that he fired Comey over the Russia investigation, and did not rely on the memo.

Sessions also contradicted a point Comey made in his testimony last week.

Comey testified last week that Sessions did not respond when he complained that he did not want to be left alone with Trump again. This was after a February meeting in which Comey said Trump told Sessions and others to leave the room before asking him to drop a probe into National Security Adviser Michael Flynn’s contacts with Russia.

Sessions on Tuesday told the committee that he was not silent, and stressed to Comey the need to be careful about following appropriate policies.

Sessions has been dogged by questions about possible additional encounters with the ambassador, Sergey Kislyak. Senate Democrats have raised questions about whether the men met at an April 2016 foreign policy event at the Mayflower Hotel in Washington. The Justice Department has said that while Sessions was there, for a speech by Trump, there were no meetings or private encounters.

Tuesday, Sessions said he did not even know Kislyak was going to be at the speech, and went only out of interest in hearing Trump delivering a foreign-policy address.

“I came in not knowing he would be there,” Sessions said in response to questions from Warner.

Comey raised additional questions in his testimony last week, saying that the FBI expected Sessions to recuse himself weeks before he actually did. Comey declined to elaborate in an open setting.

In a letter Saturday to Sen. Richard Shelby, R-Ala., Sessions said that he had been scheduled to discuss the Justice Department budget before House and Senate Appropriations subcommittees but that it had become clear some members would focus their questions on the Russia investigation. Shelby chairs the Senate appropriations subcommittee.

Sessions said his decision to accept the intelligence committee’s invitation to appear was due in part to Comey’s testimony. He wrote that “it is important that I have an opportunity to address these matters in the appropriate forum.” He said Deputy Attorney General Rosenstein would appear before the subcommittees.

Briefing congressional appropriators on the Justice Department’s budget is a critical part of the attorney general’s job. The fact that Sessions would delegate that task to his deputy showed the Russia investigation was distracting him from his core duties.

Indeed, at the beginning of the hearing, Sen. Warner scolded Sessions for nixing those other hearings.

Contributing: Associated Press, staff reports