Maryland's highest court ruled yesterday that a tough state ethics law enacted in 2001 cannot be used to punish a once-prominent lobbyist whose misconduct helped prompt the measure.

The State Ethics Commission in 2002 denied Gerard E. Evans's attempt to return to lobbying after he served a prison term for bilking clients. The Maryland Court of Appeals ruled against the commission yesterday, saying the lobbyist was convicted before the statute took effect. The court, in a 5 to 2 decision, said there was insufficient evidence that the legislature intended the law to be applied retroactively.

"It is not uncommon for a legislative body to address a problem, even a serious one, prospectively, understanding that the statute it enacts to deal with the problem may not immediately apply to those who caused the problem," Judge Alan M. Wilner wrote for the majority.

The ruling was a major victory for Evans, who boosted his earnings by fabricating legislation that threatened his clients' interests and then collecting fees to fight it. A federal judge sentenced Evans to 30 months in prison, decrying what he called a "culture of corruption" in Annapolis.

"Obviously, I'm ecstatic," Evans said. "It's a cloud that I've labored under for the last couple of years, and finally, that's been lifted."

The commission, in denying Evans a license, acted under a law that bans lobbyists from practicing if they have been convicted of crimes related to their work. Evans appealed to Anne Arundel County Circuit Court, and a judge sided with him the next year.

He has been permitted to work while the appellate court considered his legal challenge. But he did so with a fraction of the clients he represented before his conviction, when he was among the few lobbyists in Annapolis to earn more than $1 million in fees.

Evans's case was the first real test of the expansive powers granted to the Ethics Commission in 2001, when state lawmakers sought to blunt the influential role of lobbyists by passing a tough ethics law.

Arguing the case before the court, former attorney general Stephen Sachs said: "It is, I think, a perversion to suggest that the same legislature that said, 'We don't like what's been going on, the process has been discredited, we look bad, and we want [the ethics commission] to clean it up,' would then go and exempt Gerry Evans."

But Byron Warnken, a professor at the University of Baltimore School of Law, yesterday described the court's ruling as "very narrow" and said it appears to have little bearing in future applications of the ethics law. The court, he noted, ruled only that the law does not apply retroactively to convictions imposed before it was enacted.

Still, Warnken said the case has drawn interest because of Evans's high profile, as well as that of another prominent lobbyist convicted in 1994, and because of the perception that "there's generally a fine line between the art of lobbying and the crime of bribery."

Bruce Poole, a former member of the commission, said that he was disappointed by the decision and that he expects the legislature to revisit the ethics laws. Poole said he agreed with the dissenting minority on the state appeals court, which held that denying Evans a license based on his prior conviction was not retroactive.

Daniel Clements, Evans's attorney, said he thought the case was clear-cut from the day it was filed. "It's absurd to say that someone who has done his time can't be rehabilitated and go back to work," Clements said. "If it's a problem for the legislators to have him back lobbying, they have a simple solution: Don't deal with him. Don't talk to him."

Clements said the ruling "restates 80 years of Maryland law which the Ethics Commission chose to ignore because they were out to get Gerry."

He said he does not believe it has any broader application, because the central issue in the case was whether the new ethics law could be applied retroactively.

"The law is now the law. It just wasn't the law when Gerry committed his criminal act," Clements said.

The court said the statute could not be applied to Gerard E. Evans retroactively.