A church whose request to operate a temporary homeless shelter was opposed by the city of Lenexa will be able to do so after all.

Under a settlement reached on Friday, Shawnee Mission Unitarian Universalist Church will be allowed to use its building, a former elementary school, to house up to 30 homeless adults overnight from Dec. 13 through April 1 and for the next three years.

The agreement also calls for the city to work with the church to craft an ordinance permitting homeless ministries in Lenexa.

Dan Dalton, a lawyer who represented the church, said both sides had been working hard since a court hearing last week to resolve the case.

The church had asked a federal judge to issue a temporary restraining order blocking the city from preventing it from carrying out what it says is part of its sacred mission “to serve and shelter the people who are homeless.”

U.S. District Judge Daniel Crabtree urged both sides to come to an agreement and postponed ruling while they tried to reach an accommodation.

“The City of Lenexa wants to be part of a comprehensive solution to the homeless issue in Johnson County,” Lenexa City Manager Beccy Yocham said in a statement Friday afternoon. “This agreement will enable the homeless population to be served temporarily while we work toward a comprehensive solution that serves the entire community.”

The shelter will be open in the church, which is located at 9400 Pflumm Road, from 7 p.m. to 7 a.m.

The city had opposed the church’s request on the grounds the church is located in a single-family residential district. Yocham said the city plans to update its City Code “to more comprehensively address how homeless shelters are regulated throughout the community.”

“The City will engage residents and members of the faith community in this process. Like all codes, the Lenexa City Council will be the ultimate decision maker on new regulations,” Yocham said.

Lenexa has agreed to pay a portion of the church’s attorneys’ fees, $15,000.

Other provisions of the settlement agreement include:

The church will have a social worker from Project 10/20, a nonprofit that works with homeless people, on site.

The church will be allowed to feed the residents dinner and breakfast.

Church volunteers will be awake during the evenings while the residents sleep.

The church will provide fire, health and safety training to the volunteers.

Currently there is only one homeless shelter – for four adult women – in all of Johnson County. Last winter, Project 10/20 served 240 homeless individuals in Johnson County, according to the church’s lawsuit against Lenexa.

Dan Margolies is a senior reporter and editor at KCUR. You can reach him on Twitter @DanMargolies.