A US official appointed by US President Donald Trump has resigned after CNN posted excerpts of him making racist and Islamophobic comments on a radio show he used to host, the news network reports.

Carl Higbie resigned from his post as external affairs chief at the Corporation for National and Community Service, according to a statement from CNCS spokeswoman Samantha Jo Warfield, CNN says.

Higbie was not immediately available for comment.

CNN posted recordings of Higbie’s internet talk radio show Sound of Freedom from 2013 and 2014 in which he expresses his dislike of Muslims, black people and homosexuality.

“I just don’t like Muslim people. People always rip me a new one for that. ‘Carl, you’re racist, you can’t, you’re sexist.’ I’m like, Jesus Christ, I just don’t like Muslim people because their ideology sucks,” he says in one excerpt. “Most Muslims believe that to have sex with men is OK, which I don’t like it all. But second off, it’s the ideology of a child molester.”

In another excerpt he tells Muslims: “Go back to your Muslim s***hole and go crap in your hands and bang little boys on Thursday nights.”

Higbie, 34, a former Navy Seal, served as a surrogate for Mr Trump on the campaign trail during the 2016 presidential campaign, often appearing on TV to spruik campaign positions.

He was appointed to his position at CNCS in August, 2017.

Higbie also made derogatory comments about African-Americans.

“The whole African-American thing gets me whipped up because it’s like 99 per cent — and I’m paraphrasing here — of people who write down African-American have never been to Africa,” he said. “So barring dual citizenship, you’re American or you’re African, but you’re not both. I don’t care what you think. That’s another thing that just sets me off.”

Higbie said “every other black person was rude” when he put out a sign offering free firewood.

“They wanted me to either load the wood, completely split it for them or some sort of you know assistance in labour. Now, mind you the ad was for free firewood, come take it all you want. And I believe that this translates directly into the culture that is breeding this welfare and the high percentage of people on welfare in the black race. It’s a lax of morality.”

Higbie said he also didn’t believe most people who claim to be suffering with Post Traumatic Shock Disorder.

“I’d say 75 per cent of people with PTSD don’t actually have it, and they’re either milking something for a little extra money in disability or they’re just, they honestly are just lying,” he said.

Higbie also appeared to encourage others to shoot illegal immigrants

“Hey, everybody with a gun, if you want to go shoot people coming across our border illegally, you can do it for free,” he said.

Higbie dropped out of college to join the military as troops were invading Iraq in 2003. He ran for Congress in 2014.

The White House has not made a statement on his resignation or his past comments.