(RNS) — Last month, Hope Covenant Church opened the first homeless shelter in Chicago’s affluent suburban Village of Orland Park in more than three decades.

With temperatures dipping down near the single digits, the seasonal shelter has housed between 15 and 50 people one night every week, including a toddler and local public high school students.

The overnight shelter, the result of a partnership with Illinois’ Beds Plus community organization, is open every Tuesday until April — unless a lawsuit by The Village of Orland Park succeeds in closing it down.

Last week, Village attorneys filed a lawsuit against the church, arguing that the shelter “constitutes an ongoing threat to public health and safety.” The lawsuit cited 28 health and safety code violations caused by the church using the building, which was intended solely for religious services, as an overnight shelter.

“We believe we are being unfairly targeted, but we will make all reasonable changes to ensure the continuation of emergency shelter,” the church’s partner organization Beds Plus said of the lawsuit. “Everyone deserves a home.”

In court on Nov. 8, Village attorneys asked that the shelter be closed until the violations are addressed. A judge declined to grant the Village the temporary restraining order and preliminary injunction it sought against the church in order to close the shelter during the lawsuit’s proceedings.

The next hearing is set for Nov. 18.

Hope Covenant lead pastor Jon Fogel said that housing the homeless is a part of the church's ministry.

“This is a directive of our faith,” Fogel told Religion News Service in a phone interview. “To try and slap us with a restraining order because they believe that it's more safe for a 2-year-old to sleep outside on the street, than to sleep in our building, in potentially 20-degree weather ... the argument isn’t even remotely fair.”

He described the lawsuit as a “frivolous” use of taxpayer funds that was made “not in good faith,” arguing that plenty of nearby municipalities were allowed similarly set-up shelters with no issues.

An Oct. 18 inspection by Village authorities found code violations, including issues with the height of stair handrails, code-compliant exits and having the proper fire and carbon monoxide protection in the temporary sleeping rooms.

“At this point, the current status quo of allowing people to sleep overnight in a dangerous situation is something that the Village simply cannot allow, and a swift course correction was needed to protect the health and safety of those men, women, and children,” Orland Park Mayor Keith Pekau told Religion News Service. “Only a safe environment can establish a place of respite for these individuals and a safe facility is an essential starting point.”

Fogel said the inspection last month had seemed “collegial” and “overwhelmingly positive” and that he had not been informed of its results until last week, when local news media sent him a press release Orland Park’s mayor had published Nov. 6 about the code violations.

The press release, since deleted from the Village of Orland Park website, asked the church to suspend the shelter’s operations “until the fundamental safety issues can be addressed for the intended use and the building is brought into full compliance.”

Later that day, Fogel received a letter hand-delivered by Village officials, giving the church less than 24 hours to shut the shelter down or face a lawsuit.

While shelter organizers say they are on board with making improvements to the shelter to bring it up to code, Fogel says they will not shut down the shelter to do so.

“We’re not going to leave people in the cold,” he said, noting that the forecast for Tuesday night is expected to hit 9 degrees. “Obviously we’ll work with them, we want to be in compliance, but we can’t close in the meantime. These people have no other place to go. This is their only option.”

He added that the lawsuit led to an “incredible outpouring” of community support for the church’s work, with more service attendance, volunteers, donors and social media comments than ever before. Several other churches from other denominations have held prayers for Hope Covenant’s mission.

Lawyers have offered to work pro bono on the church’s behalf, and a dozen contractors and architects have offered free assistance in getting the building up to code.

“And we have to tell them, ‘Unfortunately, we don't even know whether fixing everything will even help, because that's not what they asked for,’” Fogel said. “All they've ever asked us to do is shut down. They never gave us another option.”

The lawsuit seeks at least $1,000 in fines against Hope Covenant and requires the church to submit building plans to show how the structure will be altered to meet regulations. The church will also be required to have a permit for residential use and must apply for an amendment to Orland Park’s land development code, the lawsuit says.

“If the church wishes to continue to provide food service and overnight shelter to the public, it must adhere to the applicable Village of Orland Park laws, codes and regulations and appropriate legal zoning process,” Pekau told Religion News Service. “The Village staff can assist the church in these areas, but had they gone through the proper processes to begin with, as everyone is required to do, all of these issues would have been identified ahead of time.”

Fogel told Religion News Service that both he and Hope Covenant’s attorney reached out to officials about 10 times between May and July of this year. The mayor refused to meet, he alleged.

Pakau confirmed to RNS that the mayor’s office has never met directly with the church’s officials but said that the Village had acted in a responsible manner.

“We are disappointed that the church has put the Village in the position to take this step, but the safety of everyone in our Village required us to take action," he told RNS.

Pekau has also told local media that he doubts Orland Park residents experience homelessness.

"It's certainly a nationwide problem and a metro Chicago problem, but there's not a homeless problem in Orland Park that I know of," the mayor told Patch. "I only know of one homeless individual who is often seen in Orland Park. I personally have not observed the problem here."

Orland Township Supervisor Paul O’Grady disagreed with the mayor and Village’s actions.

“For example, if a Church were hosting a Boy Scout Troop overnight stay would the Village behave in the same manner?” he said in a statement posted on Facebook. “I would hope not. Remember, the Village has decided to use our tax dollars on expensive litigation as a first resort and not a last resort. As a lawyer, I have learned over the years that sitting down and trying to work out a solution is much better than resorting to litigation.”

The church, which has about 50 members and belongs to the Evangelical Covenant Church, also offers a personal care pantry, a clothing distribution initiative and several food pantries for low-income Chicagoans.

Other homeless shelters in Chicago-area churches have also drawn controversy. In May, former residents at Pacific Garden Mission, Chicago’s largest homeless shelter, told the Chicago Tribune that the shelter fails to accommodate people with disabilities and enforces mandatory Christian services.

Last year, state lawmakers also rejected a proposal to offer churches increased protection from lawsuits when they provide shelter to those in need, an attempt to de-incentivize more houses of worship to open shelters.