Maryland Gov. Martin O’Malley (D) is about to lose a top aide who has been instrumental in many hard-fought legislative victories over the past six years, including recent bills to legalize same-sex marriage and expand the state’s gambling program.

Joseph C. Bryce, O’Malley’s chief legislative officer, plans to announce Friday that he is leaving the administration to join one of the top lobbying firms in Annapolis, Manis Canning & Associates.

“Joe knows the legislative process and has the kind of connections to people that make or break legislation,” said Senate Finance Chairman Thomas M. Middleton (D-Charles). “He’s been an invaluable asset to the O’Malley team.”

Bryce, 44, said in an interview that he’s enjoyed his time with O’Malley but was ready for a new phase of his career.

“Working for a governor gives you a lot of opportunities to work on big, meaningful things,” Bryce said. “But this is the right time for me personally to make a change.”

Aides said O’Malley is expected to elevate Stacy Mayer, a deputy legislative officer, to take over leadership of his lobbying team during an important stretch.

O’Malley, who is term-limited, has two years remaining in office and has been positioning himself for a possible presidential bid in 2016. A few of O’Malley’s high-profile legislative initiatives, including efforts to jump-start the state’s wind-power industry and expand transportation funding, have remained elusive to this point.

Bryce’s hire following O’Malley’s 2006 election was considered something of a coup.

Bryce held the same position under former governor Parris N. Glendening (D) and previously worked for Senate President Thomas V. Mike Miller Jr. (D-Calvert). As a result, he was able to help O’Malley, a former Baltimore mayor, navigate Annapolis at a time when several of O’Malley’s other top aides were new to the capital, having come with the new governor from Baltimore.

In the years since, O’Malley has racked up considerably more legislative wins than losses, including on several environmental and crime-related bills. Much of his tenure has also been spent grappling with budget challenges.

Within the past year, Bryce helped O’Malley push through bills on same-sex marriage and expanded gambling, both of which survived cliffhanger votes in the House of Delegates. Maryland voters will get the final say next week on both of those issues.

House Majority Leader Kumar P. Barve (D-Montgomery) said Bryce has benefited from a rare combination of bluntness and diplomacy.

“He’s very savvy, and he’s a real problem solver,” Barve said. “It will be a real loss.”

O’Malley has lost a handful of other top aides in recent years, including his first chief of staff and first communications director. Both left for private-sector jobs.

Bryce has two children. He is married to Kristin F. Jones, chief of staff to House Speaker Michael E. Busch (D-Anne Arundel).