President Donald Trump is really playing the role of moderator as Congress attempts to reach a deal on legislation that would shield hundreds of thousands of young immigrants from deportation, moderate Democratic Sen. Heidi Heitkamp told CNBC on Friday.

Heitkamp said she attended a bipartisan White House meeting Tuesday about the Deferred Action for Childhood Arrivals program or DACA.

Then on Thursday, a bipartisan group of senators presented the president with an agreement on new legislation for immigrants brought to the U.S. illegally as children.

But in a tweet storm Friday, Trump characterized the "so-called bipartisan DACA deal" as "a step backwards."

Tweet @realDonaldTrump 1

"I think the president really is in the middle on this," Heitkamp told "Squawk Box," referring to the DACA issue. The North Dakota Democrat added she believed the role of "moderator" is "exactly the role" that Trump is playing.

"I walked out there [Tuesday] believing that we could come to some kind agreement, and then [Thursday] it blew up again," Heitkamp said.

On Thursday, reports surfaced that Trump referred to Haiti and African nations as "s---hole countries" in a meeting that day with lawmakers. Trump later declared "the language used by me at the DACA meeting [Thursday] was tough, but this was not the language used."

But Heitkamp, who was not in Thursday's meeting, said she didn't believe Trump's comments "blew up" the negotiations.

Trump said in September that he was ending the Obama-era program. DACA would cease March 5 unless Congress can pass the protections into law.

Throwing a wrench into the debate, a federal judge ruled Tuesday that the program must remain in place while litigation over Trump's decision unfolds.

— Reuters and CNBC's Jacob Pramuk contributed to this report.