Secretary of State Mike Pompeo warned in 2016 that Donald Trump was an “authoritarian” in the mold of then-President Barack Obama, according to a video newly resurfaced by the New Yorker magazine.

The remark by Pompeo, who at the time represented Kansas’ 4th Congressional District, sharply contrasts with his lavish praise for Trump after joining the president’s administration.

“You know, Donald Trump the other day said that ‘if he tells a soldier to commit a war crime, the soldier will just go do it,’ ” the video shows Pompeo saying at a March 2016 event in Wichita. “He said, ‘They’ll do as I tell them to do.’ We’ve spent seven-and-a-half years with an authoritarian president who ignored our Constitution. We don’t need four more years of that.”

The event took place on the day of the Kansas presidential caucuses, and Pompeo had endorsed Sen. Marco Rubio (R-Fla.); after listening to Pompeo’s remarks from backstage, Trump demanded to know who Pompeo was, the New Yorker reported.

Pompeo had come to more enthusiastically embrace Trump by the time the real estate mogul accepted the Republican presidential nomination that summer, and Vice President Pence later recommended him for a job in the Trump administration, according to the magazine.

Trump nominated Pompeo to be director of the Central Intelligence Agency in November 2016, and tapped him to replace Rex Tillerson as secretary of state in March 2018. As a member of Trump’s administration, Pompeo has been one of the president's most forceful defenders, often sparring with reporters and members of Congress who question Trump’s statements and policy decisions.

In one exchange this year with Fox News Channel’s Chris Wallace, Pompeo dismissed the anchor’s questions about Trump’s position on accepting foreign opposition research as “a Washington piece of silliness.”

In another interview with CBS’s Margaret Brennan, Pompeo bristled when asked about the discrepancy between his own statement that China was holding a million Chinese Muslims in “reeducation camps” and Defense Department figures, which put the number closer to 3 million.

“Don’t play ticky-tack,” Pompeo said. “There’s no discrepancy.”

Aaron Blake contributed to this report.