An Illinois woman who runs a child care service out of her home is suing the state, saying its restrictions on day care facilities make it illegal for her to keep a gun in her house for self-defense.

Jennifer Miller’s lawsuit was filed in U.S. District Court for central Illinois after the state emerged as a battleground in the post-Parkland gun debate, with citizens and various localities trying to stake claims on either side of the issue.

Mrs. Miller and her husband, Darin, both hold concealed-weapons permits. But Illinois’ rules prohibit handguns from being kept in day care homes, with exceptions only for law enforcement or others who have to carry guns for their jobs.

Any firearms in other day care facilities have to be unloaded, kept under lock and stored separately from ammunition.

The Millers say the rules mean they have to make a choice: give up their guns or have Mrs. Miller give up her day care.

The state last month gave them a warning, the lawsuit says.

Mrs. Miller has been a day care home licensee since last year and a day care home provider since 2016. Her husband is a special equipment operator for a paper producer in central Illinois — a job that would not require him to keep a gun in the house.

Gun rights groups have taken up their cause.

“We’re in court to make sure that the state cannot discriminate against day care operators who merely wish to exercise the rights we’ve restored in Illinois,” said Second Amendment Foundation founder Alan Gottlieb, whose group brought the lawsuit with the Illinois State Rifle Association and Illinois Carry.

The lawsuit names Lisa Madigan, the state’s attorney general, and Beverly Walker, director of the state’s Department of Children and Family Services, as defendants.

Ms. Madigan’s office declined to comment on the merits of the case.

A spokeswoman for the Department of Children and Family Services said the agency couldn’t comment on pending litigation.

It’s not clear how many people are affected by the day care rules, but pro-gun advocates say local cases such as this can turn into precedent-setting expansions of gun rights.

Mr. Gottlieb pointed out that his group’s challenge to Chicago’s ban on handguns ultimately led to a 2010 U.S. Supreme Court decision affirming that states must respect an individual’s Second Amendment right to keep and bear arms.

A separate legal challenge from the group also forced Illinois to allow the concealed carry of weapons in 2013, after courts found the state’s restrictions on the practice unconstitutional.

Indeed, Illinois appears to be a hotbed of legal challenges over gun rights.

The Second Amendment Foundation, the National Rifle Association and other gun rights advocates are suing to block the village of Deerfield, in suburban Chicago, from enforcing a ban on semi-automatic firearms.

Meanwhile, Effingham County, located about 75 miles southeast of Springfield, recently moved in the other direction by pushing to become a “sanctuary” for gun owners if state lawmakers approve stricter gun controls.

A resolution the county board passed last week reads in part: “If the Government of the State of Illinois shall infringe upon the inalienable rights granted by the Second Amendment, Effingham County shall become a ‘sanctuary county’ for all firearms unconstitutionally prohibited by the government of the State of Illinois.”

Effingham County State’s Attorney Bryan Kibler acknowledged that the resolution was largely symbolic but said the county wanted to take a stand against a number of gun control bills that the state legislature is considering.

“It’s symbolic … but it really proves that people in southern Illinois are getting tired of being pushed around,” Mr. Kibler said recently on Fox News.