The University of California sued the U.S. Department of Homeland Security in federal court Friday to stop the Trump administration from rescinding a program that lets immigrants who entered this country illegally as children live and work without threat of deportation.

UC President Janet Napolitano served as secretary of Homeland Security in the Obama administration from 2009 to 2013 and created the immigrant-protection program, Deferred Action for Childhood Arrivals, or DACA, in 2012.

“At UC we see the exceptional contributions that young ‘dreamers’ make every day,” Napolitano said Friday, using the popular term for college students in this country illegally. “Many are the first in their family to go to college. Some are pursuing a Ph.D. or ambitious humanitarian goals. They represent the spirit of the American Dream. The administration has dashed those dreams. We hope by this lawsuit to restore those dreams.”

U.S. Attorney General Jeff Sessions announced Tuesday that the Trump administration will no longer accept new DACA applications. Participants can apply for renewal one last time, by Oct. 5. Ultimately, thousands of DACA recipients could be deported when their permits expire.

Sessions called the program’s creation an “unconstitutional exercise of authority by the executive branch.” He said nine states that had threatened lawsuits to halt DACA would have won their cases.

On Friday, Napolitano said: “No court has ever held that DACA was illegal.”

The suit she and the UC Board of Regents filed against Homeland Security and its acting secretary, Elaine Duke, is the first by a university. On Wednesday, 15 states and the District of Columbia also sued over the program’s termination, accusing the administration of discriminating against Mexicans. California Attorney General Xavier Becerra, who did not participate, told The Chronicle he’ll file a separate lawsuit within the state next week because a quarter of the 800,000 DACA participants live here.

UC’s suit, filed in U.S. District Court in San Francisco, seeks to void the federal action. It asks the court to declare it unconstitional, as well as “arbitrary, capricious, and an abuse of discretion.”

Joanne Talbot, spokeswoman for Homeland Security, declined to respond to the lawsuit.

UC’s suit argues that the university directly benefits from DACA, not only by employing staff who participate in the program, but by enrolling “a substantial number” of tuition-paying DACA participants among the estimated 4,000 UC students living in the country illegally.

UC’s lawsuit rests on three arguments:

• Terminating the program violates the students’ and university’s constitutional right to due process because neither UC nor the DACA recipients enrolled there had a chance to comment on the action.

• The Trump administration failed to follow procedures for terminating a program under the Administrative Procedure Act, in part because the law is applied to immigrants on a case-by-case basis, while rescinding it would affect all DACA recipients.

• The administration offered no “reasoned decision-making,” as required by law, instead making a specious claim that DACA is illegal because a federal court ruled that a different program was illegal. That program would have shielded from deportation people in the country illegally if their children were citizens or legal residents.

“President Trump has arbitrarily and unlawfully manufactured a crisis in the lives of fellow Californians,” said UC Regent Gavin Newsom, who is also the state’s lieutenant governor. He said students and staff who participate in the program are “integral to the academic and intellectual fabric of our campuses.”

California’s Senate President Pro Tem Kevin DeLeón, D-Los Angeles, said he was “grateful that the UC is taking aggressive steps to defend the DACA students and staff members who now find themselves on uncertain terrain.”

Acknowledging Napolitano’s connection to DACA, he said, “no one understands this policy better than President Napolitano.”