The US attorney general, Jeff Sessions, has rejected allegations that he took part in collusion with Moscow to influence the 2016 election as an “appalling and detestable lie”.

Sessions was testifying under oath to the Senate intelligence committee, where he faced a blizzard of questions about his meetings with the Russian ambassador to Washington during the campaign, his recusal from the issues linked to the investigation of possible collusion between the Trump campaign and the Kremlin, and his role in the firing of the FBI director, James Comey.

Sessions delivered a fierce opening statement denying any contacts with Russian officials about the campaign.

“I have never met with or had any conversation with any Russians or any foreign officials concerning any kind of interference in any campaign in the United States,” Sessions told the senators. “I have no knowledge of any conversations held along those lines by anybody in the Trump campaign.”

He added, his voice rising in indignation: “I was your colleague in this body for 20 years, and the suggestion that I participated in any collusion or that I was aware of any collusion with the Russian government to hurt this country, which I have served with honour for over 35 years, or to undermine the integrity of our democratic process, is an appalling and detestable lie.”

At his confirmation hearing on 10 January, Sessions told the Senate: “I did not have communications with the Russians,” a claim that was later proved untrue when the Washington Post revealed he had had two meetings with the Russian ambassador to the US, Sergey Kislyak, during the campaign.

Sessions argued that his statement at the confirmation hearing was not lie because of the context in which it was made – a “rambling” question from Democratic Senator Al Franken of Minnesota about collusion. He said he had been denying any meeting about the campaign. He said his meetings with Kislyak in July 2016, on the margins of the Republican convention and in September in his Senate office, had been routine and among many such encounters with foreign officials as a senator.

“He asked me a rambling question that included dramatic, new allegations that the United States intelligence community had advised President-elect Trump that ‘there was a continuing exchange of information during the campaign between Trump’s surrogates and intermediaries for the Russian government’,” Sessions said. “I was taken aback by these explosive allegations, which he said were being reported in breaking news that day. I wanted to refute immediately any suggestion that I was a part of such an activity.”

He flatly denied recent reports that he had had a third meeting with Kislyak in Washington’s Mayflower hotel in April 2016.

“I did not have any private meetings, nor do I recall any private conversations, with any Russian officials at the Mayflower hotel,” Sessions said. “I attended a reception with my staff that included at least two dozen people and President Trump. I did not have any recollection of meeting or talking to the Russian ambassador. If any brief interaction occurred in passing, I do not remember it.”

Sessions said that he would not testify about private conversations with Donald Trump, saying he “will not violate my duty to protect the confidence of communications” with the president or with other “high officials”. However, he said this was not a case of claiming “executive privilege” but rather in line with confidentiality over debates within the justice department.

Sessions said that the reason he recused himself on 2 March was related to justice department regulations that require recusal by an official from any investigation into a campaign in which that official participated.

As for the dismissal of Comey as FBI director on 9 May, he said he had raised his concerns about Comey’s performance even before his own confirmation as attorney general in February.

In the run-up to Trump’s shock decision to fire Comey in May, it was reported that Sessions had come up with the reason for getting rid of him. The White House claimed that the president came to his decision after concerns about Comey’s performance were raised by Sessions and his deputy, Rod Rosenstein, who wrote a critical appraisal of Comey focusing on his handling of the investigation into Hillary Clinton’s use of a private email server.

However, Trump appeared to contradict that rationale in a television interview and in an Oval Office conversation with Kislyak and the Russian foreign minister, Sergey Lavrov, on 10 May, in which he suggested he had decided to get rid of Comey because of the Russia investigation. If that version is true, it would strengthen the case that the FBI director’s dismissal amounted to obstruction of justice, in which Sessions could be an accomplice.

He also told NBC “that Russia thing” had played a part in his decision.

“In fact when I decided to just do it, I said to myself, I said ‘you know, this Russia thing with Trump and Russia is a made-up story, it’s an excuse by the Democrats for having lost an election that they should have won’,” Trump told Lester Holt.