Former acting attorney general Sally Yates testified Monday that she expected White House officials to “take action’’ on her January warning that then-national security adviser Michael Flynn could be blackmailed by Russia, offering her first public statements about the national security concerns that rocked the early days of the Trump administration.

Yates’s testimony to a Senate Judiciary subcommittee capped months of debate over her role in the ouster of Flynn, a retired lieutenant general who stayed on at the White House for 18 days after Yates’s warning.

The unanswered questions about whether any of President Trump’s associates coordinated with Russian attempts to meddle in last year’s presidential election have dogged the new administration since its first weeks, when the FBI’s investigation into Flynn first came to light. Congressional committees have been seeking answers to the same questions, but those efforts have been bogged down by partisan finger pointing and accusations that lawmakers are using important national security issues to score political points.

In more than three hours of closely watched testimony inside a packed hearing room, Yates described discussions she had with White House Counsel Donald McGahn, beginning on Jan. 26, in which she laid out her concerns about public claims made by Vice President Pence and other White House officials regarding Flynn’s conversations in December with Russian Ambassador Sergey Kislyak.

At the time, Pence and others had publicly denied that Flynn had discussed easing U.S. sanctions with the Russian official. Intercepts reviewed by U.S. intelligence officials showed that he had, according to people familiar with the matter.

“We began our meeting telling him that there had been press accounts of statements from the vice president and others that related to conduct that General Flynn had been involved in that we knew not to be the truth,” Yates said. “The vice president was unknowingly making false statements to the American public, and General Flynn was compromised by the Russians.’’

The hearing marked the most intense public scrutiny Yates has ever faced, but she did not appear rattled. The longtime prosecutor had kept a low profile until her brief tenure as acting attorney general, when she instructed government lawyers not to defend the president’s first executive order on immigration temporarily barring entry to the United States for citizens of seven majority-Muslim countries and refugees. Trump immediately fired her.

Sen. John Cornyn (R-Tex.) challenged her on that move, saying that while he voted to confirm her as deputy attorney general, “I find it enormously disappointing that you somehow vetoed the decision of the Office of Legal Counsel with regard to the lawfulness of the president’s order.’’

Yates calmly replied that she remembered her confirmation hearing as one “where you specifically asked me in that hearing that if the president asked me to do something that was unlawful or unconstitutional . . . would I say no? . . . That’s what I promised you I would do, and that’s what I did.’’

After further criticism on the same subject from Sen. Ted Cruz (R-Tex.), Yates made her point even more plain, saying: “I did my job.’’

During the hearing, Yates described her concerns about Flynn but was careful not to say anything that would reveal the classified details that sparked them.

“The first thing we did was to explain to Mr. McGahn and say the underlying conduct that General Flynn had engaged in was problematic in and of itself,’’ she said.

But the larger issue, she added, was concern among senior Justice Department officials that the Russians could try to use the information to manipulate Flynn.

The Russians “likely had proof of this information and that created a compromise situation — a situation where the national security adviser could be blackmailed by the Russians,’’ Yates said. “Finally we told them we were giving them all of this information so that they could take action.’’

After the initial meeting, Yates met with McGahn the following day to discuss the issue further. She said McGahn asked her why the Justice Department cared if one government official lied to another.

Yates said she emphasized that she was trying to warn them of a potential future vulnerability to Russian intelligence operatives.

“We were really concerned about the compromise here and that is why we were encouraging them to act,’’ she said.

Yates said she did not urge the White House to take any specific action, such as firing Flynn. Asked if she thought Flynn had lied to the vice president, Yates replied: “That’s certainly how it appeared, yes.’’

White House officials have said McGahn immediately took the issues raised by Yates to the president but determined there was no pressing criminal issue. It is not clear what other actions, if any, White House officials took after the warning from Yates.

The FBI has been probing whether any Trump associates may have coordinated with Russia’s efforts to meddle with the presidential election last year. Two days before Yates took her concerns to McGahn, agents interviewed Flynn about his contacts with Russians. Yates repeatedly refused to say whether she thought Flynn faced potential criminal charges over any statements made in that interview.

(Video: Reuters)

Anticipation over Yates’s testimony has been growing since a scheduled appearance in March before a House committee was scratched.

Democrats repeatedly pointed out that 18 days passed after Yates’s warning before the White House moved to force out Flynn — and that move came only after The Washington Post reported details of the Flynn-Kislyak conversation.

Even the run-up to the Yates hearing was eventful. Current and former officials said that in November, President Barack Obama warned the president-elect not to hire Flynn.

Word of that warning came shortly after Trump tried to shift the focus toward alleged leaks of classified information.

“Ask Sally Yates, under oath, if she knows how classified information got into the newspapers soon after she explained it to W.H. Council,” wrote Trump in a Twitter post early Monday, apparently misspelling the word counsel. He later retweeted the message with the word spelled correctly. The president offered no further details about his suggestion that Yates knew who might have leaked classified information. At the hearing, Yates denied leaking sensitive information to reporters or knowing who might have done so.

The president tweeted again after the hearing ended, saying Yates “said nothing but old news’’ and adding: “The Russia-Trump collusion story is a total hoax, when will this taxpayer funded charade end?”

Yates’s testimony seemed to contradict public statements made by White House press secretary Sean Spicer and White House Chief of Staff Reince Priebus. Both men described the Yates-McGahn meeting as less of a warning and more of a “heads-up’’ about an issue involving Flynn. Repeatedly in her testimony, Yates emphasized how concerned she was that Flynn’s situation could compromise national security.

Testifying alongside Yates was former director of national intelligence James R. Clapper Jr., who warned that Russian efforts to interfere with the U.S. election were so successful they “must be congratulating themselves for having exceeded their wildest expectations with a minimal expenditure of resource.”

“And I believe they are now emboldened to continue such activities in the future both here and around the world and to do so more intensely,” he said.

Lawmakers said after the hearing that Yates had revealed a number of new details they had not known before, particularly about her conversations with the White House on Flynn.

“I thought it was one of the most riveting hearings I’ve ever taken part in,” said Sen. Amy Klobuchar (D-Minn.).