The Massachusetts Supreme Judicial Court has finally put beyond doubt the power of local officials to prevent developers from tearing down small houses on undersized lots and replacing them with McMansions.

Almost two and a half years after the state’s highest court deadlocked 3-3 in the case of Katama homeowners who wanted to double the size of their house on a substandard half-acre lot, the court came down decisively against such practices in an almost identical case involving a house in Norwell.

By a 5-2 margin the court upheld the decisions by the town of Norwell and the state land court, which found developers could not buy an undersized lot with a small house on it and replace it with a new, larger structure without first being subject to review by the zoning board of appeals.

Arcane as that may seem, it significantly strengthens the hand of local authorities to protect the human environment of small towns across the state from the blight of trophy houses.

In the Norwell case, decided earlier this month, developers bought a tiny (675-square-foot) one-bedroom house and shed on a lot of 0.8 acres, which predated zoning in the town which required a one-acre minimum lot size. They planned to pull it down and replace with something five times as big — a 3,600 square-foot, three-bedroom, two or three-story house with a two-car garage.

Although the new structure would have complied with all the dimensional bylaws, such as setbacks, except for the size of the lot on which it sat, the town refused to permit it for a number of essentially environmental reasons.

The placement, height and length of the new house would not be in keeping with the rural nature of the neighborhood, the town determined. It would eliminate open space and screening, would lead to the parking of cars on the narrow country road on which it stood, all to the detriment of the neighborhood and safety and welfare of its residents.

In summary, the new construction would “exacerbate the present nonconformity of the property.”

The land court agreed on appeal, and so did the state supreme court. In the decision, the five majority judges relied substantially on the on the reasons put forward in the earlier landmark case involving the house in Edgartown.

That case dates to 2001. The Bransford family of Katama wanted to double the size of their house, built on a pre-existing half-acre lot in a 1.5-acre zone. Through their attorney, they argued that the only nonconformity of the enlarged home with relevant bylaws was the size of the lot, and they had the right to extend.

When the supreme court handed down its decision in August 2005, it was split 3-3, after one of the justices recused herself. The tied vote meant a lower land court decision in favor of Edgartown and against the Bransfords was upheld, but by no means decisively.

Since then, however, one of the dissenting justices has died. The other two took the same position in both cases: that increasing the size of a dwelling on an undersized lot, so long as it as it met other building requirements, “could not be said to increase a nonconformity that has nothing to do with building size.” Justice John M. Greaney, who wrote the majority decisions in both cases, noted in the Bransford matter there were “regional and statewide interests in the preservation of the unique quality of Martha’s Vineyard ... [which] justify the making of conservative assumptions about the consequences of land uses.”

In the more recent matter, though it related to land elsewhere in the state, his comments were equally applicable to land use controversies on the Vineyard.

He wrote: “Our decision recognizes that many municipalities do not welcome the building of structures that represent the popular trend of ‘mansionization.’

“This is especially so when the structures involve reconstruction on nonconforming lots.

“The expansion of smaller houses into significantly larger ones decreases the availability of would-be ‘starter’ homes in a community, perhaps excluding families of low to moderate income from neighborhoods.”

Edgartown town counsel Ronald H. Rappaport, who argued the original case against the Bransfords said he was pleased with the new decision.

“I am gratified that the state supreme court has upheld the Bransford decision, and it is now indisputable clear that that is the law of the commonwealth,” he said.