(Note language in 1st and 9th paragraphs that may offend readers.)

OXON HILL, Md. (Reuters) - President Donald Trump on Saturday attacked U.S. Special Counsel Robert Mueller ahead of his report on alleged Russia collusion by the Trump campaign in 2016 and said his political opponents were “trying to take me out with bullshit.”

In a speech that lasted more than two hours -- his longest since taking office two years ago -- Trump also vented about Democrats, a proposed “green new deal,” illegal immigrants and criticism of his North Korea summit, while voicing optimism about his own re-election prospects in 2020.

Addressing a cheering audience at the annual Conservative Political Action Conference in Oxon Hill, Maryland, Trump veered off-script to launch a tirade about events that led to the Russia investigation.

He mocked his former attorney general, Jeff Sessions, and former FBI Director James Comey, both of whom Trump fired.

“We’re waiting for a report by people who weren’t elected,” Trump said of the Mueller report, which is widely expected to be handed over to Attorney General William Barr in the coming days.

Deputy attorney general Rod Rosenstein appointed Mueller in May 2017 to take over the Russia investigation after Trump fired Comey, whose agency had led the probe initially. Rosenstein is expected to step down by mid-March.

Slideshow ( 4 images )

Swarms of young adults stood to applaud Trump in the packed hotel ballroom where he spoke, at times breaking into chants like “Trump is our Man” and “We Love You.”

Trump said Comey was Mueller’s “best friend,” and implied Comey should have been fired before Trump took office.

“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 a sudden they are trying to take you out with bullshit, okay?” Trump said.

“Now Robert Mueller never received a vote and neither did the person who appointed him,” he added.

Trump still has made no move to fire Mueller, a Republican and respected former FBI director who has conducted his investigation with utmost secrecy.

Trump also mocked the Southern accent of Sessions and criticized him for recusing himself from the Russia probe. In November, Trump fired Sessions, a former U.S. senator from Alabama who was among the first Republican lawmakers to back Trump’s presidential bid.

Slideshow ( 4 images )

Trump’s face perspired as he lashed out at critics after a stressful week during which his former lawyer Michael Cohen accused the president in congressional testimony of breaking the law. Also, the president concluded a summit with North Korean leader Kim Jong Un in Hanoi without reaching a denuclearization deal.

The White House has rejected Cohen’s allegations and on Saturday, Trump said his talks with Kim were productive and could lead to an agreement in which other, unspecified nations provide aid to Pyongyang.

Trump addressed criticism from the parents of Otto Warmbier, an American student who died after 17 months in a North Korean prison. They had complained when Trump said at a Hanoi news conference that he believed Kim had nothing to do with Warmbier’s death.

“I love Otto,” Trump said, but added he was trying to maintain “a delicate balance” with the North Koreans as he attempts to coax them into giving up their nuclear program.

Trump ridiculed a Democratic “green new deal” plan to fight climate change, pointing to provisions such as reducing airplane flights or eating less beef.

“This is the craziest plan,” Trump said, adding that Democratic support for it would help Republicans politically. He said he believed he will win in 2020, rejecting critics who said lack of support for Trump was behind the Republican loss of the U.S. House of Representatives last November.

“Wait ‘til you see what happens when I do run,” he said.

Democratic National Committee spokesman Daniel Wessel quickly hit back on Saturday afternoon, describing the speech in a statement as “a bizarre, unhinged rant.”