HAVERHILL — Danvers Fire Chief Kevin P. Farrell allegedly made three visits to his estranged wife’s house in Groveland before he was arrested early today. Over the course of the visits, he allegedly grabbed her hand and used it to slap himself in the face, entered her bedroom while she was sleeping, and told her he would be dead by morning.

The chief’s alleged interactions with Joanne Farrell were detailed in Haverhill District Court today, where Farrell was ordered held without bail pending a dangerousness hearing on Friday in the same courthouse.

Farrell, 49, pleaded not guilty to charges of assault and battery and witness intimidation that were filed by Groveland police after they arrested him in the Merrimack Valley town where both he and his estranged wife live at separate addresses.

Advertisement - Continue Reading Below

While it was not mentioned during Farrell’s arraignment, court records show that his estranged wife sought a restraining order against him in Sept. 24, 2010. During the incident cited in that order, the chief allegedly told Joanne Farrell and their son that he was going to kill himself with a nail gun and make sure that both had to witness it.

In court, Kevin P. Farrell’s defense attorney, Michael Baldassarre, denied that Farrell acted violently and insisted that the police overreacted when they arrested the 20-year veteran of the Danvers fire department around 2 a.m.

“This doesn't rise to the level of anything more than an acrimonious divorce,’’ Baldassarre said. “There are many steps we can take. We don’t have to lock up a 27-year decorated veteran of the fire department.’’

In court, Essex Assistant District Attorney Ashlee Logan requested that Farrell be held for a dangerousness hearing, citing Farrell’s history of mental illness, the prior restraining order, and the alleged nature of abuse.

Logan said in court that Farrell went to Joanne Farrell’s home three times Tuesday night into early Wednesday morning. During the first visit, the two had an argument that was triggered by a text message Joanne Farrell received that was meant for someone else, officials said.

During the second visit, Kevin Farrell allegedly grabbed Joanne Farrell’s hand and then slapped himself in his face with her hand several times and was ordered out of the house by the couple’s 24-year-old daughter, officials said.

During the final visit, he barged into Joanne Farrell’s bedroom while she was asleep and pulled the mattress off the bed, allegedly telling her as he did so, “You don’t listen to me.’’

He also allegedly said, “I won’t be living in the morning. I’ll be gone.’’

In a telephone interview, Groveland Police Chief Robert Kirmelewicz said Farrell’s daughter made a 911 call to his department around 1:40 a.m. to report that her father had assaulted her mother.

The daughter reported that Kevin Farrell had allegedly taken his estranged wife’s cellphone, leaving the woman unable to contact police herself because she does not have a landline in her Center Street home, Kirmelewicz said.

Farrell, according to his daughter, drove off in a red Dodge Durango with blue municipal firefighter license plates, the chief said.

Kirmelewicz said a department dispatcher tried to locate Farrell by tracking the GPS signal emanating from his cellphone, but got no electronic response. The dispatcher then tracked the woman’s cellphone and discovered that it was at the fire chief’s address on Garrison Street, Kirmelewicz said.

He said officers then responded to the chief’s home, where they spotted the Durango parked outside.

The chief said Farrell’s wife told officers that her estranged husband had been drinking at a local bar, but was not drunk. The chief said his officers did not make any reference about Farrell being intoxicated in their report.

“So my assumption would be that he was not intoxicated, or my officers would have dealt with that,’’ the chief said today.

Kirmelewicz said that after his arrest, Farrell was taken to Anna Jacques Hospital for treatment of an undisclosed medical condition.

Kirmelewicz said Chief Farrell has lived in Groveland for a number of years. He said his department has handled “some issues in the past’’ that involved Chief Farrell, but he has not been arrested by Groveland police until today.

Danvers Town Manager Wayne P. Marquis said this afternoon that he is placing Farrell on administrative leave with pay until the criminal case is resolved. He said the department will be under the command of the department's four captains for the immediate future.

Marquis also said today that he knew about the 2010 restraining order, having been told about it by Farrell himself shortly after it was issued against him.

“He came straight forward with the disclosure at the time and acknowledged he had issues,’’ Marquis said. “He addressed those issues and we had reports that were very positive.”

Marquis said that Farrell was hospitalized in 2010 for a period of time after the restraining order was issued, and then was monitored on an outpatient basis for a medical issue.

“He required medical treatment over a period of time, both inpatient and outpatient, to satisfactorily address those emotional issues,’’ Marquis said.

Marquis said that when he endorsed promoting Farrell to be full-time chief in April 2011, he was confident that Farrell could handle the job because he had completed the course of treatment set out for him by the medical professionals he became involved with.

“We worked with Kevin and there was a professionally managed and developed program that he willingly participated in and that he completed over a course of many months,’’ Marquis said. “We had feedback that some of the issues had been fully addressed and that he was at a place where he could move on and assume additional responsibilities.’’

Marquis said he notified selectmen of the issues, both in 2010 when it happened and in the spring of 2011 when Farrell’s permanent appointment to chief was a live issue. Marquis said he endorsed Farrell for chief.

“I felt he was where he needed to be in terms of carrying on, and being promoted and taking on additional responsibilities.’’

Farrell’s job as chief is a civil service position. He earns $103,903 annually in that post, Marquis said.

Farrell is the state’s second public safety official to face domestic violence charges in two weeks.

Police arrested Waltham’s police chief, Thomas M. LaCroix, on June 14 after an alleged attack on his wife. Prosecutors allege in court papers that LaCroix slammed his wife into a kitchen counter and threw her into a bicycle rack during the June 12 incident, after which LaCroix’s wife received treatment at Newton Wellesley hospital.

LaCroix has pleaded not guilty to two counts of assault and battery with a dangerous weapon, two counts of assault and battery, one count of assault and one count of intimidating a witness.

He was released from custody last Thursday and ordered to wear a GPS tracking bracelet and report to an inpatient mental healthcare facility within 24 hours. His attorney has said LaCroix needs treatment for stress.