On Saturday, Heather McGuire went to a Rockville court commissioner and said she feared for her life. Her estranged husband, she said, threatened her and lurked outside her house.

“This has been going on for many years and has been escalating,” McGuire, 36, wrote in a criminal complaint. “My children believe he is gonna kill me.”

Three days later, police say, Philip Gilberti, 51, made good on his threat, allegedly shooting McGuire while the two were inside a van on Connecticut Avenue, then pushing her body onto the road.

After launching a massive manhunt, police late Tuesday found a dead man they identified as Gilberti in a house in Rockville. Gilberti, who had been charged in a warrant with first-degree murder in McGuire’s death, apparently killed himself, said Montgomery County Police Chief J. Thomas Manger.

Police officers were searching for Gilberti in a neighborhood off of Rockville Pike by late afternoon, Manger said. Gilberti, a one-time boxer, apparently had been threatening people all day by telephone, including people in his own family, Manger said. Police used those sources to help determine his whereabouts.

Philip J. Gilberti (Courtesy Montgomery County Police)

When efforts to make contact with Gilberti failed Tuesday night, police sent in a robot. About 10:30 p.m., a tactical team went inside and found his body on the floor, Manger said.

The Saturday complaint by Gilberti’s wife followed years of trouble between the couple, who were married in 2009 and were going through a divorce, according to court records. In the three days before the shooting, Gilberti was twice taken into custody after allegedly threatening McGuire. Both times he was released on bond on orders that he remain away from her.

But about 9:40 a.m. Tuesday, police think the pair were together, driving south on Connecticut Avenue in a gray or green van. Witnesses told police that a man and woman in the van seemed to have some sort of altercation, Manger said. At least one witness reported that it looked like the woman tried to get out but that the man pulled her back in and shot her, he said. After the woman fell to the road, the van sped off.

Bystanders, and later police officers, administered first aid as McGuire lay in the street, but she died at the scene.

In court papers, McGuire had said she and Gilberti have three children. Police said none of the children have been harmed.

The recent tension between McGuire and Gilberti appeared to flare early Saturday, when a police officer was called to a home on Hallet Place in the Aspen Hill area, where McGuire was with a friend, according to court papers.

Inside, McGuire told the officer that Gilberti, who court papers say is 6-foot-2 and 285 pounds, had come to the home, banged on the door and screamed her name, according to arrest documents. McGuire also told the officer she thought Gilberti had placed a tracking device on her van because he kept showing up at places he couldn’t have known she’d be, according to the records.

She told the officer she was “very scared” of Gilberti. The officer confirmed that she had an active restraining order against him. Officers arrested him a short time later at a McDonald’s on Rockville Pike.

Gilberti was taken before a court commissioner at the jail, posted a $4,500 bond and was released by noon, according to court records. It was about 12 hours later that McGuire filed her complaint, stating that he had returned to her house and was lurking outside, court records say.

He was arrested the next day, according to court records. This time, the court commissioner ordered him held in jail without bond, pending a review hearing on Monday before District Court Judge Barry Hamilton.

A court official who evaluated Gilberti told the judge that if he were released, Gilberti could participate in a pretrial program that would include substance-abuse treatment.

Curt Zeager, a prosecutor from the Montgomery state’s attorney’s office, did not request a specific bond but said Gilberti in the past had refused to stay away from McGuire.

“The domestic violence unit is very familiar with Mr. Gilberti because of his repeated inability to stay away from the victim in this case,” Zeager said. “We would ask your honor to take that into consideration as you set the bond.”

Hamilton was clearly exasperated by Gilberti’s behavior, noting how quickly he contacted McGuire after he was released from jail Saturday. He “can’t even wait a day to contact her,” Hamilton said.

Gilberti spoke, asserting that in recent days McGuire had been comfortable around him.

“We were together at the Econo Lodge,” Gilberti said. “I mean, she’s not afraid of me. She violates her own protective order. Tim and I just loaned her $2,000 a week ago for a security deposit for a house.”

Zeager, the prosecutor, said that statement alone was an admission that Gilberti had violated the restraining order. “The bottom line is he’s been through the court process. He knows he’s not to have contact with her. It just smacks of the conditioned psychology of domestic violence circumstances.”

Hamilton assigned Gilberti unsecured personal bonds totaling $57,500. Such bonds allow people to leave jail without having to put up any cash or property. Hamilton ordered him to stay away from McGuire and to abide by other conditions pending trial.

“Your honor, I promise I will abide by all these conditions,” Gilberti said. “I just thought I could help her.”

“Yeah, well, put that thought aside,” Hamilton said. “That thought’s not working for you so good.”

Staff writer Katherine Shaver and staff researcher Magda Jean-Louis contributed to this report.