Massachusetts voters narrowly rejected Question 7, a ballot measure that would have made it easier to build smaller starter homes across the state, the Associated Press projected on Friday — three days after Election Day, with the last statewide question finally called.

With about 99 percent of the expected vote counted as of Friday afternoon, the No side led 1,287,917 to 1,255,595, or about 50.6 percent to 49.4 percent — a gap of 32,322 votes out of more than 2.5 million cast, according to unofficial AP results. The final count has not yet been certified.

Question 7 would have barred cities and towns from requiring more than 5,000 square feet and 50 feet of street frontage for a single-family home on a lot with public water and sewer service, overriding stricter local minimum-lot rules in many communities. Supporters, led by the Legalize Starter Homes campaign, argued it would help address the state’s housing shortage of about 220,000 homes; a Tufts University study estimated it could create thousands of net new homes in its first decade.

The Massachusetts Municipal Association, which represents local officials in the state’s 351 cities and towns, was the most prominent critic, arguing the measure stripped local control and did nothing to guarantee affordability. As of Friday, 274 of the state’s 351 cities and towns had voted No.

The biggest Yes vote came from the one city the measure would never have touched: Boston, which runs on its own zoning code outside the state zoning act, backed Question 7 by more than 2 to 1, 119,998 to 53,286. Without Boston, the measure lost by about 99,000 votes. The result leaves current law in place, with each city and town continuing to set its own minimum lot sizes.