WASHINGTON — President Trump, speaking to the Conservative Political Action Conference for more than two hours on Saturday, went on a series of extended riffs that included the Academy Awards and Hollywood.

As he was talking about meeting generals on his recent visit to Iraq who looked and sounded like they were out of “central casting,” Trump described a story of a drill sergeant who was brought in to advise on a movie. The sergeant was so good that he ended up getting cast.

Trump said that the military veteran should have won an Academy Award, but did not. “That’s because Hollywood discriminates against our people,” he said to the crowd at the annual conference, taking place at National Harbor, Md.

Trump didn’t name the actor or the movie, but he may have been referring to R. Lee Ermey, who was a former Marine Corps staff sergeant and gunnery sergeant and served as a drill instructor. He was hired by Stanley Kubrick to advise on his movie “Full Metal Jacket,” but he ended up being cast in the movie as Gunnery Sergeant Hartman. He earned a Golden Globe nomination. Ermey, who died last year, also had roles in “Apocalypse Now,” “Seven” and the remake of “The Texas Chainsaw Massacre.”

Trump’s speech covered a lot of ground, as he talked of his recent summit with Kim Jong-un, mocked proposals for a “green New Deal,” chided Republicans for opposing his emergency declaration to build a border wall, and imitated his former attorney general Jeff Sessions’ southern accent. As he does in most rally-like speeches, he targeted the media as “fake news.”

He also used profanity to rail against Sessions and Special Counsel Robert Mueller’s Russia investigation.

“Unfortunately, you put the wrong people in a couple of positions, and they leave people for a long time that shouldn’t be there, and all of the sudden they are trying to take you out with bullshit. With bullshit.”

The comment drew roars of approval from the crowd.