A federal judge ordered the administration of U.S. President Donald Trump to restore funding for hundreds of foreign aid contractors who argued that they were negatively impacted by a 90-day blanket freeze, a court filing showed late on Thursday.

The order temporarily blocks the Trump administration from canceling foreign aid contracts and awards that were in place before Trump took office on Jan. 20.

It was the first such ruling to reverse Trump's funding freeze on foreign assistance. The ruling came in a lawsuit brought by two health organizations that receive U.S. funding for overseas programs.

Trump has attempted to dismantle government agencies, including the U.S. Agency for International Development, as he has embarked on a massive reshaping of government and has tasked his billionaire ally Elon Musk with cost-cutting.

The stated purpose in suspending of all foreign aid was to provide the opportunity to review programs for their efficiency and consistency with priorities, U.S. District Judge Amir Ali wrote in a filing in the U.S. District Court for the District of Columbia.

He added: "At least to date, defendants have not offered any explanation for why a blanket suspension of all congressionally appropriated foreign aid, which set off a shockwave and upended reliance interests for thousands of agreements with businesses, nonprofits, and organizations around the country, was a rational precursor to reviewing programs."

Trump has also ordered agencies to prepare for wide-ranging job cuts, and several have already begun to lay off recent hires who lack full job security.

The Republican has fired and sidelined hundreds of civil servants and top officials at agencies in his first steps toward downsizing the bureaucracy and installing more loyalists.