June 5 (Reuters) - A federal judge ordered the Trump administration on June 5 to restore programs funded by AmeriCorps grants in 24 Democratic-led states but declined to bar the federal agency for national service and volunteering from cutting the bulk of its workforce.

U.S. District Judge Deborah Boardman in Baltimore issued an injunction requiring the administration to reinstate millions of dollars in grants in those states and the District of Columbia and ordered the administration to restore thousands of volunteer service workers the administration had sent home.

Her ruling applied only to the Democratic-led states who sued in April to challenge what they said was an unlawful dismantling of AmeriCorps by Republican President Donald Trump's administration.

Maryland Attorney General Anthony Brown, a Democrat who helped lead the litigation, in a statement said the ruling safeguards services communities rely on to educate students, preserve parks and care for the elderly from "unlawful and reckless cuts."

AmeriCorps did not respond to requests for comment.