Sally Yates implied she'd disobey the president back in 2015. Jeff Sessions was the guy who asked.

Sally Yates was dismissed from her position of acting attorney general on Monday, along with any illusion that President Donald Trump would tolerate anything less than blind allegiance from his chief law-enforcement officer.

During her Senate confirmation hearing to become deputy AG back in 2015, Yates' questioners thought a willingness to stand up to the president was a good thing. Just ask Sen. Jeff Sessions (R-Ala.) — the man who grilled her at the time and who will take Yates' old job if confirmed by the Senate this week:

"Do you think the attorney general has a responsibility to say 'no' to the president if he asks for something that's improper?" Sessions asked Yates during the 2015 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 that 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 said.

Ironically, Yates was ultimately fired by Trump for giving — and then acting on — her independent legal advice. Four days after Trump signed an executive order banning people from seven Muslim-majority countries from entering the U.S., Yates — an Obama appointee who was serving as the acting attorney general under Trump — said the Department of Justice could not defend Trump's order in court.

Deputy Attorney General Sally Yates speaks during a news conference at the Justice Department in Washington.J. David Ake/AP

"[At] present, I am not convinced that the defense of the executive order is consistent with my responsibilities nor am I convinced that the executive order is lawful," Yates wrote in a letter to top DOJ lawyers on Monday. "Consequently, for as long as I am the acting attorney general, the Department of Justice will not present arguments in defense of the executive order, unless and until I become convinced that it is appropriate to do so."

Later that night, Trump fired her. White House press secretary Sean Spicer issued a statement saying Yates had "betrayed" the DOJ. “Ms. Yates is an Obama administration appointee who is weak on borders and very weak on illegal immigration,” the statement read

The Senate is expected to vote on the confirmation of Sessions as U.S. attorney general on Tuesday. Sessions was one of the first members of Congress to endorse Trump for president back in February, according to the Washington Post. He is also considered by some to be the "intellectual godfather" of Trump's Muslim ban.