DETROIT — An Islamic academy will get $1.7 million and be allowed to build a new school after it settled a federal lawsuit against a Michigan township that initially denied its zoning request.

The Michigan Islamic Academy will move ahead with plans to build the school and housing on land in Pittsfield Township, near Ann Arbor, after township officials approved the settlement Wednesday.

The academy sued after the township rejected its request to build in 2011. The academy — which has classes in pre-kindergarten through 12th grade — says its current Ann Arbor location is insufficient to meet its religious and secular needs.

The lawsuit claimed the township violated the federal Religious Land Use and Institutionalized Persons Act, which protects individuals, houses of worship and other religious institutions from discrimination in zoning laws.

“This has been in litigation for 4 ½ years,” said Lena Masri, legal director for the Michigan chapter of the Council on American-Islamic Relations. “They’ve had to make do with the overcrowded classrooms, and the students have had to compromise their education.”

Construction of the new school is expected to start in the spring, Masri said.

The Muslim civil rights organization filed the lawsuit in 2012 in federal court in Detroit on behalf of the academy.

Township officials also settled a Justice Department lawsuit that was filed in 2015. That lawsuit was in response to a federal investigation launched after the Michigan Islamic Academy sued Pittsfield Township.

“Federal law protects the religious beliefs, freedoms and practices of all communities, including the right to build religious institutions free from unlawful and unfair barriers,” said Vanita Gupta, head of the Justice Department’s Civil Rights Division. “This agreement will allow the Michigan Islamic Academy to build the facility it needs to serve its members and contribute to the community of Pittsfield.”

Even with the settlement, the township denies any wrongdoing, discrimination or law violations, Pittsfield Supervisor Mandy Grewal said in an email Thursday to The Associated Press.

“The original proposal that was rejected by the township, called for high-volume, multi-use facilities with little to no buffering,” Grewal said. “The township’s position from the beginning was and continues to be about protecting existing residents in this region from land uses that were not originally envisioned when they purchased their homes. Traffic safety and congestion in the heart of a single-family residential subdivision were our foremost concerns, which have been addressed in the settlement.”

The settlement requires significant landscape buffering between adjacent residential lots, she added.

The $1.7 million will be paid by the township’s insurer, which recommended the settlement, Grewal said.