Taxes on marijuana could reach up to 20 percent, under a marijuana law rewrite Massachusetts lawmakers announced Monday.

The proposed taxes break down as follows: 6.25 percent sales tax, state excise tax at 10.75 percent and local option tax of up to 3 percent that can be set by cities and towns.

"I anticipate most communities if not all will be at 3 percent," said Rep. Mark Cusack, a member of small group of lawmakers who worked on the compromise behind closed doors at the State House.

Cities and towns could also receive an additional 3 percent through a community host agreement with a retail pot shop company.

"In addition, we also require as part of the licensing process that [retail pot shop companies] have a host agreement with the host community, but we cap that at 3 percent of gross sales," he said. That could bring the total potential tax rate at 23 percent.

The law passed by 1.8 million voters in November set the tax rate at up to 12 percent. The law, which broadly legalized recreational use of marijuana for adults age 21 and over, also called for a voter referendum process to determine the fate of possible retail pot shops.

Under the deal announced Monday, Massachusetts communities that voted in November against the recreational marijuana ballot question will be able to ban local pot shops through action taken by their locally elected officials. Communities that voted "yes" have to hold a voter referendum if they want to ban or restrict pot shops.

But after December 31, 2019, all communities will have to hold a voter referendum, under the proposed compromise. "Any community that voted 'no' last November I presume will be acting before that deadline," Cusack said.

The deal could be on Gov. Charlie Baker's desk before the end of the week. A vote on the deal in the House is tentatively set for Wednesday, while the Senate is expected to take it up Thursday.

The deal also includes a five-member Cannabis Control Commission to regulate the new marijuana industry. One appointed by governor, one appointed by state treasurer, one appointed by attorney general and the majority of those three select the next two.

The commission chair would selected by the treasurer and the executive director is chosen by the majority of the Cannabis Control Commission members. All of them would full-time and paid employees.

The lawmakers are also rewriting the medical marijuana law voters passed in 2012. The state's medical marijuana program will be taken from the state's Department of Public Health and rolled under the Cannabis Control Commission.

Medical marijuana remains tax-free under the lawmakers' deal.

"We also ensure there is a bona fide health care patient relationship, meaning that it's for a chronic disease or a serious disease, and ongoing," Cusack said. "We don't want people showing up like in California saying they're stressed at work and they don't eat well, 'here's your medical card.'"

The compromise would also allow physicians assistants and nurse practitioners will be able to prescribe medical marijuana.

"We have protected the right of adults to grow, possess, and use marijuana," said Sen. Pat Jehlen, the Senate's top negotiator.

"To give them access to a safe, legal supply, the bill removes barriers to the development of a legal market," she said in a statement. "It protects the rights of medical marijuana patients, and gives opportunity to farmers and to people who have been harmed by the War on Drugs. The tax rate remains among the lowest in the country, and the same as in Oregon, often seen as successful."