Former acting Attorney General Sally Yates took heat from Senate Republicans Monday as she stood by her decision not to defend President Trump’s executive order restricting travel from certain countries – with one Republican asking: “Who appointed you to the United States Supreme Court?”

Yates spoke at a Senate Judiciary subcommittee hearing, and defended her stance on Trump’s controversial order restricting immigrants and refugees from several terror hot spots, including Iraq, Syria and Yemen. Yates was fired in January after telling her staff at the Department of Justice not to implement the order.

“I did my job the best way I knew how,” Yates told senators during the hearing.

Yates noted that a federal appeals court blocked the order, forcing the Trump administration to revisit and re-work the order. But Republican senators attacked Yates for refusing to defend the order.

Sen. Ted Cruz, R-Texas, cited a statute in the U.S. Code granting presidents the right to impose restrictions on those seeking to enter the country if he believes there to be a security risk, but Yates countered by arguing that it is also prohibited to restrict immigrants based on race or religion.

While the Trump administration has said the order is not a “Muslim ban,” Yates and judges ruling against the order have pointed to rhetoric during the presidential campaign in which Trump promised an outright ban on Muslims into the country.

Sen. John Cornyn, R-Texas, also pushed back against Yates’ decision, saying he was “extremely disappointed” in her refusal to defend the order. He noted that the Office of Legal Counsel had concluded the law was lawful and properly drafted.

"I find it enormously disappointing that you somehow vetoed the decision of the Office of Legal Counsel...and decided instead that you would countermand the executive order of [President Trump] because you happened to disagree with it as a policy matter," Cornyn said.

“I made a determination that I believed that it was unlawful. I also thought that it was inconsistent with the principles of the Department of Justice,” Yates responded. “And I said no.”

Sen. John Kennedy, R-La., was more aggressive in his approach, questioning whether Yates had the authority to declare the order unconstitutional.

“Who appointed you to the Supreme Court of the United States?” he asked her.