A federal judge's ruling could pave the way for taxpayer-funded legal representation for immigrants facing deportation in cases of mental incapacity -- a move praised by civil libertarians but opposed by advocates of stricter immigration enforcement.

U.S. District Court Judge Dolly Gee recently ordered the U.S. government to give two mentally incapacitated illegal immigrants legal representation to fight their deportations. The decision was triggered by the case of Jose Franco-Gonzalez, 30, who spent nearly five years in immigration custody after pleading guilty to assault with a deadly weapon because authorities determined he was too mentally incompetent to represent himself in his own deportation hearings. Traditionally public counsel is not supplied in U.S. deportation cases

Gee ruled that Franco and another plaintiff be released and that additional plaintiffs in the case be given representation for their hearings, pleasing supporters who say the decision is a first step in ensuring that the rights of the mentally ill are not ignored.

But critics say the decision inappropriately places a new financial burden on American taxpayers and ignores the risk of keeping sometimes dangerous immigrants in the U.S.

Franco, an illegal immigrant from Mexico, comes from a family of U.S. citizens and legal residents and was on his way to obtaining legal resident status when he pleaded guilty in April 2005 to assault with a deadly weapon, according to the complaint.

The government moved to deport him, but an immigration judge ordered the proceedings be closed based on Franco's diagnosed moderate mental retardation and inability to represent himself.

Even so, Franco remained in immigration custody for four and a half years without having a hearing on his detention until December 2009, the complaint says. He was released in March 2010, three days after the ACLU filed a lawsuit on behalf of him and five other plaintiffs with similar cases.

Click here to read the complaint with information on Franco and other plaintiffs.

"These are individuals who get lost in the system because of their serious mental illnesses. Many of them suffer from hallucinations, many of them suffer from paranoia caused by their hallucinations and they're just simply incapacitated and unable to represent themselves," Michael Steinberg, one of the attorneys for the plaintiffs, told FoxNews.com.

But retired Immigration and Naturalization Service senior agent Michael Cutler says it's not the government's responsibility to provide legal defense for aliens who face removal from the United States.

"We are under extreme economic difficulties right now," Cutler told FoxNews.com. "For this court to create a legal precedence where aliens would be entitled to get lawyers fees paid for by the government when it's very likely, based on what these people were involved with, that they're never going to be really productive members of our society, flies in the face of what's in the best interest for America and Americans."

Cutler says judges need to remember why we have immigration laws.

"The fundamental reason for immigration laws is to keep aliens out of our country or remove aliens from our country whose presence is harmful to our nation and/or our citizens. We have people involved with mental illness and prone to fits of violence based on mental illness -- where's the positive impact this has on America?" he said. "The idea that we want to be compassionate is misplaced if one of these guys goes off and injures someone or worse."

Steinberg says regardless of their mental states the immigrants in question, some of them legal, may have meritorious defenses and have a right to have those defenses heard.

"They may be actually able to stay here, and I think any society is judged by how they treat those who are without ability to help themselves," he said.

Steinberg says he and his colleagues plan to file a motion "promptly" to transform the case into a class-action suit so that it will pertain to all detainees with mental disabilities.

Charles Miller, spokesperson for the Civil Division of the Department of Justice, said the department couldn’t comment on the case "because it’s an ongoing matter right now."