WASHINGTON—Sebastian Gorka, a national security adviser to President Donald Trump left his post on Friday, two White House officials said.

Mr. Gorka—who was close to former chief strategist Steve Bannon, who left his job at the White House earlier this month—said in a letter that “forces that do not support the [Make America Great Again] promise are—for now—ascendant within the White House.”

“As...