A Lakeville middle school principal who has been on leave since mid-January was charged Thursday with stalking the police detective who is investigating him over allegations he hacked into a colleague’s electronic devices, along with other victims.

Christopher Endicott, 49, was charged with gross misdemeanor stalking after he was arrested Tuesday and booked into Dakota County jail.

Apple Valley police Capt. Nick Francis said the charge is separate from an earlier case of computer hacking. That situation is complex, Francis said, because of the high number of alleged victims. Authorities say investigators are just starting to investigate Endicott’s electronic devices.

“But unfortunately, all our investigation for all those victims had to stop once our officer was a target of the stalking,” Francis said.

To protect his safety, Apple Valley police did not reveal the officer’s identity.

Endicott’s attorney, Bruce Rivers, said he didn’t immediately know the extent of the stalking accusations leveled against his client.

“I just know a little bit about it and there’s a lot more to it,” Rivers said. He said he had not read the complaint.

Endicott has not given a statement to authorities, Francis said. His bail was set at $6,000.

Police began to investigate Endicott after a woman working in the Rosemount-Apple Valley-Eagan School District reported that her phone and iPad connected to a school district server had been reset many times and that she did not reset them. Apple Valley police executed search warrants and said the intrusions came from Endicott’s Apple Valley home and an IP address in the Lakeville Public School District where Endicott worked.

According to Thursday’s charges, Endicott stalked the woman and several others, including the detective who began the initial investigation. Endicott allegedly broke into their homes and vehicles and stole personal information, including names, addresses, Social Security numbers, and passwords for apps used by the victims.

During the investigation, an Apple Valley detective obtained an order to track Endicott electronically, the charges said.

Authorities created electronic barriers in areas where victims lived or worked to protect their safety, police said. An electronic tracking device was placed on Endicott’s car on Jan. 12, the charges said.

On two occasions, Endicott allegedly crossed the electronic barrier placed around the detective’s home. On Saturday night, the detective assigned to investigate the initial case reported that pings from the tracking device and software indicated Endicott was near his residence.

Endicott made a second trip to the detective’s residence on Monday, authorities said.

Endicott has been on leave from Century Middle School in Lakeville since Jan. 5 when police began looking into the unauthorized access of a cellphone and computer equipment belonging to a woman who worked at Scott Highlands Middle School in Apple Valley.

IT staff in the Rosemount-Apple Valley-Eagan School District determined that the resets had been performed remotely. School district IT staff learned that their computer system had been accessed for 18 months by somebody outside the district. Authorities allegedly traced the intrusions to Endicott.

Endicott’s wife, Andrea, a counselor and teacher at Scott Highlands Middle School in Apple Valley, also was placed on leave.

The Apple Valley police and the Dakota County electronic crimes unit continue to investigate. Endicott’s next court hearing is scheduled for March 8.

“It seems to get more complex as we go,” Francis said. “But with the amount of electronics and all that data, it’s going to be a number of months for us to get through that."