Washington (CNN) California Democratic Sen. Dianne Feinstein suggested Tuesday that then-President Barack Obama's executive order establishing protections for young undocumented immigrants may not have been legal.

As the Trump administration announced Tuesday it would end the Obama-era program known as Deferred Action for Childhood Arrivals, Attorney General Jeff Sessions said the decision came in part because the administration thought creation of the program was an illegal action that would fall apart in the face of threatened lawsuits from several state attorneys general.

Asked in an interview with MSNBC's Chuck Todd if DACA was legal, Feinstein cited the legal threats, then said she didn't want to delve into the issue.

"The point is, DACA is here," Feinstein said.

Todd then noted that the senator seemed to think the Obama executive order was "on shaky legal ground."

Feinstein responded: "It is. That's why we need to pass a law, and we should do it."

When he moved to strip protections from deportation for hundreds of thousands of young undocumented immigrants, Trump included a delay before the decision takes effect and called on Congress to pass a bill enacting a permanent solution.

Ashley Schapitl, a spokesperson for Feinstein, told CNN the California Democrat remains a strong advocate for the Obama-era DACA program.

"Sen. Feinstein is a staunch champion of DACA and signed onto an amicus arguing its legality," Schapitl said. "It's no secret the 5th Circuit may hear a lawsuit brought by Republican attorneys general. That's obviously the legal threat to which she was referring. She'll continue to speak out in favor of DACA and the DREAM Act."

Feinstein, a top Democrat and the oldest living senator, is nearing the end of her current term and has not formally declared her intention to run for re-election. But in the fiercely blue state, she could face pressure from within her own party; Feinstein has recently faced criticism from Democrats in her district for not speaking out strongly enough against Trump.

In the interview, Feinstein said she believes Congress can act on immigration reform and cited attempts she was involved in to pass comprehensive immigration legislation in the past. She said the ability exists for agreement on a number of immigration issues, but establishing a permanent DACA program should be priority one.

"We could do a number of things, but we have to move quickly," Feinstein said. "And I think the first one that we need to do is assure these 800,000 young people that they are going to remain in this country."

.@SenFeinstein agrees that DACA was on "shaky legal ground" prior to @POTUS action today https://t.co/JGohaA8wPl — Sarah Sanders (@PressSec) September 5, 2017

White House press secretary Sarah Sanders noted the exchange on Twitter, writing: ".@SenFeinstein agrees that DACA was on 'shaky legal ground' prior to @POTUS action today."