Dozens of members of the Muslim community packed a Dakota County courtroom Tuesday morning to listen as attorneys debated the legality of Castle Rock Township’s denial of a plan for an Islamic cemetery.

Officials from the township near Farmington rejected the cemetery proposal last year. Al Maghfirah Cemetery Association sued the township board, saying it did not have legal grounds to turn down the plan.

As Minnesota’s Muslim population grows, space is running out in existing cemeteries, community leaders said. The Castle Rock Township site, which the cemetery association purchased last year, would provide generations of Muslims with an exclusive final resting place, supporters said.

“This is historic for me,” said Hassan Mohamud, an imam and director at the Minnesota Da’wah Institute in St. Paul, as he looked around Tuesday at the diverse group of Muslims from different mosques in the Twin Cities who gathered to watch the court proceedings. “This is the first time I saw them all united.”

The attorneys for the township and for the cemetery association presented their motions for summary judgment to Judge David Knutson. The judge has 90 days to make a decision, said Jessica Schwie, a lawyer representing the township.

Much of the back-and-forth centered on whether the township board can reject the cemetery because of tax concerns.

When board member Russ Zellmer voted against the project, he said he didn’t want to remove the 73-acre site — which would be tax-exempt as a cemetery — from tax rolls when three other cemeteries are already located in Castle Rock Township.

That is a fair reason to reject the plan, Schwie said. The township board’s job is to ensure the health, safety and welfare of residents, and by trying to have a balanced tax base board members are doing just that, she said.

But Brandt Erwin, attorney for Al Maghfirah Cemetery Association, said the association complied with all the township’s criteria and should have been allowed to move forward.

“There’s nothing in the ordinance that says three cemeteries are enough,” he said.

And the 73-acre cemetery would take up 0.3 percent of the municipality’s total land, so the tax impact would be negligible, Erwin said.