WASHINGTON (Reuters) - A U.S. judge on Sunday ruled the Trump administration did not act lawfully when it named a former Virginia attorney general as the acting director of U.S. Citizenship and Immigration Services (USCIS) and invalidated some new asylum directives.

FILE PHOTO: Ken Cuccinelli, acting director of U.S. Citizenship and Immigration Services, speaks to the news media at the White House in Washington, U.S. September 27, 2019. REUTERS/Leah Millis

U.S. District Judge Randolph Moss in Washington ruled Ken Cuccinelli’s appointment violated a 1998 law governing how vacancies in senior government positions may be filled until the U.S. Senate confirms a new permanent choice.

Moss said Cuccinelli’s appointment would relieve the president “of responsibility and accountability for selecting acting officials” and could essentially allow the executive brand to fill many senior jobs “with nearly anyone” by simply creating a new position after a vacancy.

Last year five Honduran asylum seekers and the Refugee and Immigrant Center for Education and Legal Services sued to challenge the lawfulness of asylum directives issued under Cuccinelli.

Department of Homeland Security (DHS) spokeswoman Heather Swift said in an e-mail “we obviously disagree with the court’s opinion and are looking more closely at it.” The Justice Department did not immediately comment.

Moss’ ruling said only the five asylum seekers who sued were entitled to new proceedings before USCIS and he declined to extend relief to others who had been denied asylum or ordered removed under Cuccinelli’s directives.

Cuccinelli, who is performing the duties of deputy director of DHS, assumed the USCIS job as acting director through a series of moves.

After USCIS director L. Francis Cissna resigned in June 2019, his deputy director, Mark Koumans, assumed the post as director, as required under law, Moss said.

DHS’s acting head Kevin McAleenan then appointed Cuccinelli to serve in the newly created position as principal deputy USCIS director.

McAleenan, who has since resigned, also revised the order of succession at USCIS to place Cuccinelli’s job ahead of Koumans, allowing Cuccinelli to take over as acting director.

Three weeks after taking office, Cuccinelli issued a revised policy for scheduling credible-fear interviews in expedited removal proceedings.

Cuccinelli’s directive reduced time for asylum seekers to consult with others before their credible-fear interviews from 48 or 72 hours to “one full calendar day from the date of arrival at a detention facility” and prohibited asylum officers from granting asylum seekers extensions to prepare “except in the most extraordinary of circumstances.”

John Lewis, senior counsel at Washington-based advocacy group Democracy Forward, said the “decision raises serious questions about the lawfulness of other actions Cuccinelli has undertaken - or may yet undertake - and we and others will be looking at them closely.”

Much of DHS is still being run by acting officials, including the top person, chief of staff, general counsel, as is the top official at U.S. Immigration and Customs Enforcement.