MIAMI, Florida (CNN) -- An illegal immigrant dishwasher who lost $49,000 to the U.S. government as he tried to take it home to Guatemala will get some of the money back, his attorney said Wednesday.

Pedro Zapeta, an illegal immigrant, managed to save $59,000 while working as a dishwasher for 11 years.

Pedro Zapeta was "very, very happy" when he learned about a federal appeals court ruling that says he is entitled to recover some of the money, said attorney Robert Gershman, who handled the financial end of Zapeta's case.

Zapeta was carrying $59,000 in cash when he was stopped at a security checkpoint at Fort Lauderdale-Hollywood International Airport in 2005. He told authorities he was returning home to Guatemala with the money he had saved working illegally as a dishwasher over 11 years.

But federal law requires that anyone leaving or entering the country with $10,000 or more must declare it. Because Zapeta had not done so, he was detained, and his money was seized.

The 11th U.S. Circuit Court of Appeals ruled Monday that the judge who fined Zapeta applied an incorrect standard in determining the amount to be forfeited. The appeals court ordered a hearing to set a new fine.

"I am extremely happy," Gershman said. "Even though he is not a citizen, it shows he has equal rights."

Gershman has said Zapeta, who does not speak English, was not trying to conceal the money but did not know the law. Zapeta had paid taxes on the earnings, he said, and under legal guidelines should be fined at most $5,000 for failing to report that he was traveling with the cash.

Circuit Court Judge James Cohn instead fined Zapeta $49,000, all the money he was carrying over the $10,000 limit.

"The government always acted as if the money was their own," Gershman said. "They acted almost entitled to it. But it's not their money. It was Pedro's, and the [appeals] court affirmed that."

Zapeta said last year that he had saved the money to build a house for himself and his family in his home village in the Guatemalan mountains. He returned to Guatemala this year under the threat of deportation, but his lawyers continued to argue that his fine was excessive.

Federal prosecutors in Miami did not immediately respond to a request for comment on the decision or on whether they will appeal to the U.S. Supreme Court.

As Zapeta's case was publicized, U.S. residents donated money to him, and Gershman set up a trust. It has received about $15,000 in donations, he said.

All About Immigration • Guatemala