Former House Speaker Sal DiMasi was cleared on Thursday to register as a lobbyist by a Superior Court judge who overturned Secretary of State William Galvin's decision to reject DiMasi's application based on his past convictions on federal corruption and extortion charges.

The ruling could return to the State House a man who once wielded tremendous power on Beacon Hill until he was caught and convicted of accepting kickbacks in exchange for steering lucrative state contracts to a Burlington-based software firm.

Superior Court Judge Robert Gordon ruled that if the Legislature had intended to make a conviction on federal criminal charges grounds for automatic disqualification from lobbying in Massachusetts it should have explicitly listed those crimes as triggers for the legal action.

Instead, the 2009 state law cited by Galvin to deny DiMasi's application to lobby only calls for anyone found to be "in violation" of state ethics, lobbying or campaign finance laws to be automatically disqualified from lobbying for 10 years.

Judge Gordon's decision to side with DiMasi's narrow interpretation of the state lobbying laws means that the former North End Democrat may soon be allowed to join the list of former speakers who have gone on to lobbying careers after their years as an elected official were ended by legal trouble.

"We are gratified by today's decision, which adopts our 'common-sense construction' of the Lobbying Law. As we have said from the beginning, the Secretary did not have authority to disqualify Mr. DiMasi from registering as a lobbyist. Mr. DiMasi looks forward to using his knowledge and experience to advocate for important causes such as healthcare for the homeless and prison reform," said Meredith Fierro, DiMasi's attorney.

Galvin, however, said he intends to appeal. "This decision sets a very bad precedent and I will be appealing it," the secretary said in a short statement.

DiMasi, who led the House from 2004 to 2009, served five years in federal prison until his compassionate release in 2016 to battle cancer. He made a public appeal last year for a "second chance" after his health improved and he sought to restart a career advocating for issues like prison reform.

"Whatever you think I did, I think I've paid my debt to society and I think I can get a second chance to be a contributing citizen so that I can benefit the citizens of Massachusetts," DiMasi told reporters in November.

The former North End Democrat's attempt to resurrect his career in politics, however, was greeted with a closed door by Galvin, who in March 2019 rejected his application to register as a lobbyist.

DiMasi appealed the denial, but an administrative hearing officer from Galvin's office upheld the secretary's decision in December, prompting DiMasi to seek relief from the courts.

Gordon wrote in his ruling that the narrow construction of the law argued by DiMasi is "no more absurd" than the broad interpretation sought by Galvin.

The judge cited a Supreme Judicial Court precedent from a 1986 case involving the Boston Retirement Board in which the state's highest court recognized as significant the Legislature's failure to reference federal crimes in state statute as a trigger for legal consequences.

In fact, Gordon wrote that "one might fairly deride as absurd" the notion that a law intended to create guidelines for an automatic denial, which would remove discretion from the process, should be interpreted to also give the secretary the freedom to decide which federal and non-Massachusetts crimes were analogous to the ones enumerated in the statute.

The judge also suggested that based on DiMasi's federal convictions he could have been prosecuted under state statutes by the attorney general, but wasn't, and cast doubt on the prospects for Galvin's "alternate theory" for denial should he pursue it.

Galvin's office has suggested that DiMasi also could have been denied based on his failure to register as a lobbyist while also serving as speaker and advocating for the software firm, Cognos -- the same action for which he was convicted of corruption.

Gordon was appointed to the Superior Court bench in 2013 by former Gov. Deval Patrick. Prior to that, he worked at the Boston law firm Ropes & Gray for more than two decades, with a focus on labor and employment law.