BOSTON — Massachusetts lawmakers signed off Wednesday on a compromise bill that makes changes to the voter-approved law that legalized adult use of recreational marijuana and expressed confidence the revamped measure could withstand any legal challenge.

The House of Representatives voted 136-11 to accept the recommendations of a six-member conference committee that spent weeks trying to resolve differences between the House and Senate on issues including taxes and local control.

The Senate, without debate, also approved the bill which was expected to be formally sent to Gov. Charlie Baker’s desk following a routine procedural vote on Thursday.

The compromise sets a 10.75 percent state excise tax on recreational marijuana that would be assessed on top of the state’s regular 6.25 percent sales tax. Local communities can also tack on additional 3 percent tax on pot sales, for an effective 20 percent tax. Medical marijuana would remain untaxed.

The House had proposed a 28 percent tax on recreational marijuana, while the Senate originally voted to stick with the 12 percent tax called for in the November ballot question.

Legislative negotiators came to an unusual resolution of a dispute over local control of pot shops, but one that some legal experts have suggested could run afoul of equal protection provisions in the state constitution.

In 260 cities and towns where a majority of voters backed the ballot question, a referendum would be required to prohibit or restrict marijuana stores from opening. But in the 91 communities that voted against legalizing recreational marijuana, it would require the approval only of the city council or board of selectmen to keep pot shops away.

House Majority Leader Ron Mariano said legislative counsel saw no problem with the divided approach.

“We think we are on solid legal ground and we’re not really concerned about a constitutional challenge to this bill,” said Mariano, a Quincy Democrat.

The Massachusetts Municipal Association, which represents the interests of cities and towns, called the solution “unfortunate and disappointing.” The group had sought to give all communities, regardless of how they voted in November, the power to control marijuana establishments through their local governing bodies.

The Massachusetts law allows people 21 and older to possess up to one ounce of recreational marijuana and grow up to a dozen pot plants per household. Retail marijuana sales are expected to begin in mid-2018.

The state is among eight where recreational marijuana is legal and in some, including Colorado and Washington, the tax rate is higher than it will be in Massachusetts.

The Legislature was criticized by legal pot advocates who said tinkering with the ballot question was disrespectful to the will of voters.

But lawmakers argued that few voters had read the 21-page ballot question in its entirety, and it was appropriate for state officials to review and strengthen the law.

“We’re in a lot better place than we were when we started,” said House Speaker Robert DeLeo, who had opposed the ballot question.

Baker, a Republican who also opposed legalizing marijuana, has 10 days to act on the bill, but is likely to sign it.