President Trump fired acting Attorney General Sally Yates on Monday night over her refusal to comply with his controversial executive order temporarily banning immigration from seven predominantly Muslim countries and suspending the entire U.S. refugee program.

But during Yates’ 2015 Senate confirmation hearing, Alabama Sen. Jeff Sessions — who is now Trump’s yet-to-be-confirmed nominee for attorney general — grilled Yates on her responsibility to defend the Constitution and U.S. laws against then-President Barack Obama’s “unlawful” views.

“You have to watch out because people will be asking you to do things and you need to say no,” Sessions said during the hearing. “If the views the president wants to execute are unlawful, should the attorney general or the deputy attorney general say no?”

“Senator, I believe the attorney general or the deputy attorney general has an obligation to follow the law and the Constitution and to give their independent legal advice to the president,” Yates replied.

Sen. Jeff Sessions questions Sally Yates during her 2015 confirmation hearing. (Screenshot: C-SPAN)

Video of the hearing was unearthed by CNN on Monday after Yates was abruptly fired and replaced by Dana Boente, U.S. attorney for Virginia’s Eastern District.

Earlier in the day, Yates sent a memo to Justice Department staffers instructing them not to defend Trump’s executive order.

“My responsibility is to ensure that the position of the Department of Justice is not only legally defensible, but is informed by our best view of what the law is after consideration of all the facts,” Yates wrote in a memo. “At present, I am not convinced that the defense of the Executive Order is consistent with these responsibilities, nor am I convinced that the executive order is lawful.”

Yates testifies before the Senate Judiciary Committee during her confirmation hearing, March 2015. (Photo: Pablo Martinez Monsivais/AP)

Shortly after he was sworn in, Boente released a statement rescinding Yates’ order and vowing to “defend the lawful orders of our president.”

The Senate Judiciary Committee is set to vote on Sessions’ nomination Tuesday morning. Sessions is expected to be easily confirmed, as Republicans control a majority in the Senate, and his nomination can’t be filibustered.

Story continues

Critics have raised questions about whether Sessions, an early endorser of Trump during the campaign, would make sure that the Justice Department is independent from the White House’s political aims. In a recent statement to the Washington Post, White House chief strategist Steve Bannon called Sessions “the fiercest, most dedicated, and most loyal promoter in Congress of Trump’s agenda, and has played a critical role as the clearinghouse for policy and philosophy to undergird the implementation of that agenda.”

“What we are witnessing now is the birth of a new political order,” Bannon added. “And the more frantic a handful of media elites become, the more powerful that new political order becomes itself.”

More from Yahoo News: