The tweet, showing Sessions' advising Yates to do the very thing Trump just fired her for, has since gone viral.

During Yates' 2015 confirmation hearing for deputy attorney general, Sessions told Yates, "You have to watch out because people will be asking you do things you just need to say no about."

"Do you think the attorney general has the responsibility to say no to the president if he asks for something that's improper?"

Sessions gave an example of then-President Obama nominating Loretta Lynch as the attorney general.

"A lot of people have defended the Lynch nomination, for example, by saying that 'Well, he appoints someone who's going to execute his views. What's wrong with that?' But if the views the president wants to execute are unlawful, should the attorney general say no?" Sessions asked Yates.

Yates responded, "Senator, I believe the attorney general or the deputy attorney general has the obligation to follow the law and the constitution and to give their independent legal advice."

Sessions also told Yates that it "shouldn't take you too long to say, 'No, this isn't right'" to the president.