High school teacher Rebecca Drake’s personal life got complicated last year.

Her house had been foreclosed on, she and her ex-husband were in court with a bankruptcy filing and she was about to have her third baby. Facing “extreme personal circumstances” Drake temporarily moved in with her boyfriend in Pennsylvania, about 10 miles from the New Jersey border, her attorney said.

All was fine until her employer found out. The Somerville Board of Education hired a private investigator to track Drake to the house in Newtown, Pennsylvania, where the investigator watched the English teacher walk out the door at 8:34 a.m. and take her kids to school, according to court papers.

That was enough for the Somerville school district to go to court to try to get the tenured teacher fired after 12 years in the district.

In a lawsuit filed last year, the school district’s attorneys argued Drake violated the New Jersey First Act, a 2011 state law that requires public officials -- from state agency workers to county clerks to local school teachers -- to live in New Jersey.

Drake has spent the last year in court trying to keep her job, arguing in legal papers that the state law violates her "fundamental rights and is unconstitutional.”

Her attorney questions whether it really matters to Somerville High School students whether their English teacher sleeps at night in New Jersey or a few miles over the Pennsylvania border.

“We don’t think it has a bearing on the quality of the education you get,” said Richard Friedman, the Trenton attorney representing Drake.

The school district’s attorneys say Somerville plans to continue the case -- even though Drake has since gotten a waiver from a state board to allow her to bypass the law to live out of state because of her financial “hardship.”

“Ms. Drake was given an opportunity to tender her resignation, but she refused to do so, necessitating that Somerville file the lawsuit at issue. We are confident that Somerville will prevail in this case and trust that the court will require her to pay the district’s legal fees and costs so that the taxpayers don’t have to do so," said Marc Zitomer, the school district’s attorney.

Drake is still employed by the school district in her $75,401-a-year teaching post, though she is currently on medical leave, her attorney said. The attorneys for both sides continue to trade legal briefs as the case slowly moves toward a trial in Superior Court in Somerset County.

"Unfortunately, all of this could have been avoided if Ms. Drake simply did the right thing and resigned once she moved to Pennsylvania,” Zitomer said.

Under the “New Jersey First” law signed by Gov. Chris Christie in 2011, nearly all public employees are required to live in the state. The only exceptions are for workers who can prove a financial hardship, cite a health reason or provide proof they are “critical” in their workplace.

Any employee who was already living out of state when the law was signed in 2011 is grandfathered in and doesn’t need to move. But other employees, including Drake, who were already living in New Jersey are required to stay in the state if they want to keep their public jobs.

An NJ Advance Media analysis of state records published in April found at least 2,310 public employees have bypassed the law and gotten a pass to live out of state because they successfully applied for exemptions.

Drake applied to the state Employee Residency Review Committee for an exemption, citing her financial problems, in December 2017. But her application was rejected. Her attorney said Drake did not show up for the hearing in Trenton, which is optional, and the committee rejected her application because she did not provide enough paperwork documenting her financial problems.

She applied again in May 2018 and was granted the exemption by the committee, allowing her to live out of state as long as she has her teaching job in Somerville. However, by the time she got the waiver, the school district had already filed its lawsuit to fire her, according to the lawsuit.

Drake has filed a counter claim in court, alleging she is being discriminated against because she took a maternity leave and family leave after giving birth to her third child in February 2018, shortly before the school district’s lawsuit was filed.

Her attorneys said they believe New Jersey is the only state in the nation that requires all public employees, including teachers, to live within the state borders. Many cities and local governments also have laws requiring public employees, including police officers and firefighters, to live within their borders.

Friedman, Drake’s attorney, says the court rulings that say residency laws are legal date back to the 1950s and 1960s and are ripe for a legal challenge.

Meanwhile, Senate Minority Leader Tom Kean Jr., R-Union, is pushing legislation in the state Legislature to kill the New Jersey First law and lift restrictions on where state employees can live. The legislation has been introduced in both the state Senate and Assembly, but had not moved forward.

Even if the law is rewritten, it will likely not affect Drake’s case. She plans to keep fighting in court to keep her teaching job, her attorney said.

“She’s not thrilled about it. But she’s prepared to see it through,” Friedman said.

Kelly Heyboer may be reached at kheyboer@njadvancemedia.com. Follow her on Twitter @KellyHeyboer. Find her at KellyHeyboerReporter on Facebook. Find NJ.com on Facebook.

Have a tip? Tell us. nj.com/tips

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.