Sally Yates was fired as acting attorney general by President Trump on Monday for defying his executive order on immigration — but two years ago, she was pressured by Sen. Jeff Sessions Jefferson (Jeff) Beauregard SessionsTrump's policies on refugees are as simple as ABCs Ocasio-Cortez, Velázquez call for convention to decide Puerto Rico status White House officials voted by show of hands on 2018 family separations: report MORE (R-Ala.) to stand up to the president when she disagrees with him.

Sessions, who is now Trump's nominee for attorney general, grilled Yates during her 2015 confirmation hearing on standing up to then-President Barack Obama Barack Hussein ObamaGOP senator blocks Schumer resolution aimed at Biden probe as tensions run high D-Day for Trump: September 29 Obama says making a voting plan is part of 'how to quarantine successfully' MORE.

After Trump fired Yates, video resurfaced of the exchange.

"You have to watch out because people will be asking you to do things and you need to say no. You think the attorney general has the responsibility to say no to the president if he asks for something that's improper?" Sen. Jeff Sessions (R-Ala.) asked Yates.

ADVERTISEMENT

“A lot of people have defended the [Loretta] Lynch nomination, for example, by saying, ‘Well, he appoints somebody who’s going to execute his views, what’s wrong with that?' ” Sessions asked. “But if the views the president wants to execute are unlawful, should the attorney general or the deputy attorney general say no?”

Yates responded: "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.”

The exchange has gone viral since Monday night, when Trump announced he would fire and replace Yates.

“The acting Attorney General, Sally Yates, has betrayed the Department of Justice by refusing to enforce a legal order designed to protect the citizens of the United States. This order was approved as to form and legality by the Department of Justice Office of Legal Counsel,” the White House said in its Monday statement.

Trump's executive order places a 90-day ban on entry to the United States for people from Iran, Iraq, Syria, Yemen, Sudan, Libya and Somalia. It also suspends the refugee resettlement program for 120 days and indefinitely suspends accepting refugees from war-torn Syria.