A federal judge ruled Sunday that one of the Trump administration's top immigration officials, Ken Cuccinelli, was unlawfully appointed to his post because of a decades-old law on federal vacancies.

U.S. District Judge Randolph Moss ruled that Cuccinelli's appointment as the acting director of U.S. Citizenship and Immigration Services (USCIS) circumvented a law that said a senior government position could be filled only if the Senate first approved the individual.

It was not immediately clear what impact this would have on Cuccinelli's tenure, if any.

HARMEET DHILLON: IT'S UP TO THE SUPREME COURT TO DECIDE FATE OF SANCTUARY CITIES

Cuccinelli, also the deputy secretary of Homeland Security, was given his role after his predecessor at USCIS, Lee Cissna, resigned in June 2019. USCIS Deputy Director Mark Koumans should have rightfully assumed the post, Moss outlined in his ruling.

However, acting DHS Secretary Kevin McAleenan, who later resigned, created a position for Cuccinelli, naming him the principal deputy USCIS director, and then reorganized the department to place his role ahead of Koumans' position.

Since Cuccinelli was not legally eligible to serve as acting USCIS director, according to the judge, some of his decisions -- including one that limited the access some asylum-seekers had to obtain legal counsel -- could be voided.

Three weeks after assuming his post at USCIS, Cuccinelli implemented a new directive that cut the time asylum-seekers had to prepare and complete "credible fear interviews."

Cuccinelli's rule gave migrants at least one calendar day to prepare for the screening interviews, instead of 72 hours for families and, generally, 48 hours for single adults. Extensions were granted only "in the most extraordinary circumstances," such as a serious illness or mental or physical disability.

Moss's ruling concluded a lawsuit filed on behalf of five Honduran asylum-seekers challenging Cuccinelli's new rules, but the ruling allowed only the five defendants in the suit to revisit their asylum cases with USCIS, not the other asylum seekers who also may have been affected.

Cuccinelli told Fox News last November his biggest concern was "how DHS rolls forward from a leadership standpoint. I have had discussions with the president and the White House about that, and we'll have to see where the dust settles."

CLICK HERE FOR THE FOX NEWS APP

He continued, "I saw recently senators, bipartisan senators, saying "hey, we want more of these slots filled." Well, it might help if the Senate would move them a little faster."

Republican senators warned the White House that appointing Cucinelli would violate the law and face backlash from the courts.