Social media erupted with glee Thursday across the country and in Utah from “Dreamers” — an estimated 650,000 undocumented immigrants brought as children to America — when the U.S. Supreme Court blocked the Trump administration’s attempt to end the program that allows them to continue living here legally.

The 5-4 decision turned back the effort to dismantle the Deferred Action for Childhood Arrivals program but left open the door for Trump, if reelected, to make another attempt following the guidelines the justices say he must.

Meanwhile, supporters of the ruling — including the direct beneficiaries of the DACA program — said the only path to a permanent solution goes through Congress.

“There was a lot of joy. It was definitely a sense of relief,” said Alonso Reyna Rivarola, who came from Peru as an 11-year-old and now is assistant director for the Office of Diversity and Multicultural Affairs at Salt Lake Community College.

“Everyone’s just sharing what a monumental decision this is, and how excited they are,” added Heidi Chamorro, a law school graduate who was brought from Mexico at age 3. “I’m still in shock because I honestly thought they would get rid of it. But it is a lifesaver for so many people.”

Liliana Tapia Balaños, another “Dreamer,” cried with joy as she talked about the decision.

“I got very emotional because waiting for the decision really was so scary” and threatened to take away her life here, said the junior at Ensign College in Salt Lake City. My family in the United States is celebrating. My family in Mexico is celebrating.”

But the court left open a way for Trump to still push to end the program that protects hundreds of thousands nationally, including 9,700 dreamers in Utah. Ending DACA had been one of the president’s central campaign promises.

Chief Justice John G. Roberts Jr. wrote the majority opinion, joined by the court’s four liberal members — going against his usual conservative allies on the court.

“We do not decide whether DACA or its rescission are sound policies,” the chief justice wrote. “We address only whether the agency complied with the procedural requirement that it provide a reasoned explanation for its action.”

The decision was the second from the high court this week cheered by liberals. Monday, justices ruled 6-3 (with Roberts again in the majority) that gay and transgender people are protected in the workplace by the 1964 Civil Rights Act.

Trump denounced both rulings on Twitter as “shotgun blasts into the face of people who are proud to call themselves Republicans or Conservatives,” and turned it into a call for his reelection.

The technical nature of the DACA ruling — focusing on administrative procedures but stopping short of ruling on the program’s merits or legality — tempered the initial joy of many Dreamers as they realized the ruling allows ways for the president to again try to end DACA if he chooses — and merely says he acted improperly so far and failed to provide an adequate reason to justify ending it.

But experts say for such an effort to wend its way through the legal system to the high court a second time could not be accomplished in the remaining months of Trump’s term and would depend on his reelection.

Chamorro, the Utah law school graduate, said the possibility of another bid to undo DACA adds to a feeling “that people are constantly on this loop feeling like this life they have built in the United States is going to be taken away. I hope that going forward, Congress does something to change this.”

Reyna Rivarola added, “While we’re celebrating, we’re also really cognizant of that fact that DACA could go away, and that it doesn’t protect at least 10 million people,” the number of other undocumented immigrants who do not qualify for it. “So it’s hard to be fully satisfied when you know that so many are still not protected.”

Immigrants worry that the Trump administration, which is often critical of immigrants, will not only try again to halt DACA — but that it might even try to deport those who draw attention to themselves by applying for the program too quickly before administration plans are clear.

“We really want people to take this very cautiously,” said Mayra Cedano, executive director of Communidades Unidas (Communities United), which often helps people apply for DACA.

She urges potential new applicants first to consult with groups such as hers to see if they would likely qualify, and then wait for the U.S. Customs and Immigration Service to post instructions about how it plans to proceed.

The court decision “is great news, but we still have to wait for USCIS to give us instructions. So we’re telling community members to wait,” Cedano said.

USCIS signaled Thursday that it will still try to end the program. Joseph Edlow, the agency’s deputy director for policy, issued a statement saying, “Today’s court opinion has no basis in law and merely delays the President’s lawful ability to end the illegal” DACA program.

An immediate positive outcome of the ruling, Cedrano notes, is that while the court battle was underway, DACA has not allowed new applicants for years, although it allowed renewals.

“We’re really excited that this ruling opens the opportunity for new applications,” Cedano said. “For the last few years, since DACA was put on hold, we were talking to a lot of families, a lot of young adults, who actually qualify but never had the opportunity. Today’s decision opens the doors for those still in the shadows.”

DACA — which President Barack Obama implemented after saying he was frustrated that Congress failed to enact permanent immigration solutions — marked its eighth anniversary on Monday. And Utah Dreamers say it has changed their lives and allows them to contribute to America. They also hope that Congress will enact permanent protection soon.

Tapia Balaños said thinking about how different her life would have been in a crime-filled area in Mexico brings tears.

“My parents sacrificed so much to give me safety and education. The DACA program gives me an opportunity to repay them for that, and to give a future for my children,” she said.

She is an intern at the nonprofit Voices for Utah Children, which helps pay DACA application fees and provides other assistance. “The $500 fee is a lot. It’s always been a struggle for me to get enough money myself for my application.”

DACA not only helped Chamorrow to attend college, but also law school. She was one of two DACA recipients who petitioned the Utah Supreme Court to allow them to take the bar exam, which it recently permitted.

“I and my copetitioner are now just doing our bar hours to be able to get our license,” she said. But she said she had “a lot of anxiety and stress” as she faced a November deadline to reapply for DACA but knowing “that this might be my last two years” with protection under the program.

Reyna Rivarola said DACA allowed him to obtain a master’s degree, and work in jobs to help other immigrants — including being the former director of the Dream Center at the University of Utah.

“It’s really a blessing to be able to continue the work,” he said.

While he said Thursday’s court decision is good news, “We are also in a prime moment to continue pushing for a permanent solution that could fix the status of the entire undocumented community and not just some.”

Meanwhile, the Trump administration and opponents of DACA attacked the decision.

Acting Department of Homeland Secretary Chad Wolf said, “The DACA program was created out of thin air and implemented illegally. The American people deserve to have the nation’s laws faithfully executed as written by their representatives in Congress — not based on the arbitrary decisions of a past administration. This ruling usurps the clear authority of the executive branch to end unlawful programs.”

Acting Deputy DHS Secretary Ken Cuccinelli added, “The Supreme Court’s decision is an affront to the rule of law and gives Presidents power to extend discretionary policies into future Administrations.”

Jessica Anderson, executive director of the conservative Heritage Action for America, said, “President Obama violated the Constitution in creating the DACA program in the first place and President Trump is right to roll it back. This decision erodes the rule of law and will lead to more illegal immigration.”