Ahead of midterms,Trump rallies Republicans, criticizes Democrats in fiery speech at GOP retreat

His remarks were a different tone from his State of the Union address.

On Thursday, he rallied Republicans to elect more GOP members to Congress so they would not have to “compromise” on legislation and took a few pot shots at Democrats for sitting “stone cold” during his State of the Union remarks.

The 2018 midterms will be the first national referendum on Trump’s presidency. Republicans are trying to hold on to both chambers in Congress. Democrats are hoping Trump’s ascendancy to the Oval Office will rally their base enough to give them control of at least one chamber.

The midterms could potentially have an impact on Trump’s agenda if Democrats win and use their power to increase scrutiny on his administration.

But, he reminded the crowd of GOP lawmakers, “We have to get help from the other side or we have to elect more Republicans,” he said of trying to accomplish their agenda. “We have a good chance of doing that. ‘18 is going to be very interesting.”

He added: “If we win more we don’t have to compromise so much.”

In order to win back the House, Democrats need to pick up 25 seats. Their hopes have been raised by the large number of Republicans retiring, who have resigned or running for another office – 41 by ABC News' count – and by polling that shows voters favor the Democratic candidate on the generic congressional ballot.

Trump kept his focus on his party in his 35 minute speech.

He called out lawmakers by name to praise them and he said that Ryan called him the other day to say he's never seen the Republican Party as united as it is now.

"You know, Paul Ryan called me the other day, and I don't know if I'm supposed to say this, but I will say that he said to me he has never, ever seen the Republican party so united, so much in like with each other, but literally the word united was the word he used. It's the most united he's ever seen the party, and I see it, too," Trump said.

The president also mentioned his immigration plan, which he encouraged the Senate to take up.

But he appeared to be changing his tune on the Dreamers ahead of the March 5 DACA deadline and as Republicans are deeply divided over a solution.

"I've been hearing about DACA for so many years. Some people call it 'Dreamers' — it's not 'Dreamers.' Don't fall into that trap," he said.

The sharp line comes on the heels of his dig at Dreamers Tuesday night when he said "Americans are dreamers too," during his State of the Union address. He repeated the “Americans are dreamers” line in his West Virginia remarks.

Not so long ago Trump claimed to "love" the Dreamers.

"We love the Dreamers," the president told ABC’s Cecilia Vega last September. He's also promised to treat them "with heart."

Last week, when asked if Dreamers should be concerned about being deported on March 5th if there's no deal, Trump said: "Tell them not to be concerned. Tell them not to worry. We're going to solve the problem."

But both Thursday’s remarks and Tuesday’s State of the Union address touched on themes and lines Republican can use as they campaign over the next 10 months, emphasizing America should come first.

"America First" was a message the president used again and again in the 2016 election. And he ended his West Virginia speech with his famous slogan from his presidential bid.

“Together, we are indeed making America great again.”

Devin Dwyer and Katherine Faulders contributed.