Massachusetts’ highest court heard arguments on Monday in the ongoing battle between the town of Milton and the state over whether Milton needs to abide by the MBTA Communities Law.

Supreme Judicial Court Justices questioned two main points as each side made their case — whether Attorney General Andrea Campbell has the authority to enforce compliance of the law, and whether the guidelines behind the law were created properly.

The high stakes case will impact the state’s housing crisis and the power of the AG’s office to enforce a law that requires communities with MBTA stations to zone for more multi-family housing.

The law impacts 177 communities across the state. Milton is the only one that is not currently in compliance, according to Campbell.

Other towns, such as Holden, have threatened to not comply, but still have time to meet a deadline for the planning process. That makes the lawsuit all the more important in avoiding a domino effect, Campbell said.

Milton voters rejected a plan that would have put the town into compliance with the law. As a result, the town lost state grant funding.

Ahead of the hearing, Campbell made her pitch during a press conference at her office.

“No one should be able to pick and choose which laws they want to comply with. And I hope the court will see the significant consequences of continuing to allow Milton’s non-compliance,” Campbell said.

She said if Milton prevails in the case, there’s a chance other communities will follow suit.

Lawyers for Milton have argued that Campbell is overstepping her authority, that the guidelines are too restrictive, and that Milton should not be considered a rapid transit community.

Kevin Martin, an attorney representing Milton, told GBH News he’s cautiously optimistic following Monday’s hearing, though it’s hard to tell exactly how the court may rule.

“We thought we had some good arguments going into the hearing today and we believe we were able to address any concerns the justices may have had.”

The guidelines behind the law were created by the Executive Office of Housing and Livable Communities. They determine where residential zoning should be and how many units should be built, with flexibility based on each city or town’s needs.

The Justices questioned whether they were created properly, and whether they are regulations rather than guidelines.

“If the guidelines were improperly promulgated because in fact they are regulations, I think the answer to Justice Wolohojian’s question is that this case must be dismissed,” said Associate Justice Dalila Argaez Wendlandt, following up on questions from Associate Justice Gabrielle Wolohojian.

Wolohojian had specifically asked about the timeline’s impact on the validity of the case against Milton.

“If I understand correctly, the point at which Milton, in your view, violated the statute, was when it didn’t enact a zoning plan by a certain date. But if the certain date only comes from the guidelines and the guidelines need to be done over then, then what is there to enforce against Milton?” She asked.

Martin said neither side would be hoping for a dismissal of this case, especially because other cities and towns in Massachusetts are waiting on results of the lawsuit.

The SJC is expected to deliberate for at least several weeks.