WATCH: Sally Yates humiliates Ted Cruz after he tried to corner her on the Muslim ban

Sally Yates humiliated Sen. Ted Cruz (R-TX) when he tried to attack her position on President Donald Trump's controversial travel ban.

Yates was fired as acting attorney general for refusing to defend Trump's executive order banning travelers from some majority-Muslim nations, which she said violated the U.S. Constitution's religious protections.

Cruz argued that the Office of Legal Counsel had issued a determination that the order was legal, but Yates said that finding ignored the First Amendment in favor of an obscure statute that had since been updated.

"In this particular instance, particularly where we were talking about a fundamental issue of religious freedom, not the interpretation of some arcane statute, but religion freedom, it was appropriate for us to look at the intent behind the president's actions and the intent is laid out in his statements," Yates said.

Cruz then tried to trip her up by suggesting her actions were extraordinary.

"In the over 200 years of the Department of Justice history, are you aware of any instance in which the Department of Justice has formally approved the legality of a policy and three days later the attorney general has directed the department not to follow that policy and to defy that policy?" Cruz said.

Yates delivered the final blow by accusing the Office of Legal Counsel of violating longstanding norms.

"I'm not, but I'm also not aware of a situation where the Office of Legal Counsel was advised not to tell the attorney general about it until after it was over," Yates said.

Cruz then tried one final jab after thanking Yates for her testimony.

"I would not that that might be the case if there's reason to suspect partisanship," Cruz said, to audible groans.