Suspect identified in York County shooting that killed 3 officers: AP

Matthew James Ruth, 24, was identified by the Associated Press on Thursday as the shooter accused of opening fire on police, killing three officers and injuring two. 

The shooting happened Wednesday afternoon while officers were serving a domestic-related warrant at a property in North Codorus Township, York County.

What we know:

The deadly shooting happened just after 2 p.m. Wednesday when police were following up on a domestic-related investigation in North Codorus Township. 

Investigators say during the interaction, a gunman – later ID'd by the Associated Press as 24-year-old Matthew James Ruth – opened fire on police officers.

RELATED: Police officers killed in York County shooting: What we know about the suspect

Three officers suffered fatal gunshot wounds and two others remain hospitalized in serious condition. Ruth, investigators say, was killed by police in the shooting.

Dig deeper:

Court documents obtained by FOX 29 News revealed disturbing details about Ruth's interactions with a woman who lives at the home whom he recently dated.

Police were called to her home on Haar Road a day before the shooting after she reported that a man wearing camouflage was standing in her driveway peering into her home with binoculars.

The woman spotted the man on a trail camera that she had installed after her truck had intentionally been lit on fire about a month ago, according to the affidavit.

Police later found the suspect's black Ford Ranger pickup truck unoccupied on the roadside just around the corner from the victim's property. 

In further conversations with police, court documents say that the victim speculated that the person standing in her driveway and the person who lit her truck on fire may have been her ex-boyfriend, Matthew Ruth.

She told police that she and Ruth only dated for a short period of time, and that Ruth had never been to her house during their brief relationship. Court documents also revealed that the victim told police Ruth owns a black Ford Ranger pickup truck.

When the victim showed police a photo of the man standing in the driveway, officers noticed the suspect had an AR-15 style rifle slung across his chest while he peered into the residence. Officers spent the next several hours searching for Ruth in the area, but did not find him.

A warrant was issued for Ruth on charges including stalking, loitering and prowling at nighttime, and criminal trespassing.

What we don't know:

Dave Miller, a neighbor who spoke to FOX 29 News, speculated that the shooting on Wednesday may have had to do with a recently ended relationship.

"I was told that she ended the relationship, and he couldn't handle the news," Miller said.

None of the slain officers have been publicly identified.

What they're saying:

Gov. Josh Shapiro denounced the shooting and ordered all flags on state-owned property to fly at half-staff.

U.S. Attorney General Pam Bondi called violence against police officers "a scourge on our society."

What's next:

Pennsylvania State Police Commissioner Colonel Christopher Paris, Pennsylvania Attorney General Dave Sunday, and York County District Attorney Timothy Barker will hold a press conference on the shooting on Thursday at 3 p.m.

You can watch the update in the live player above or on the FOX 29 YouTube page.

Crime & Public SafetyPennsylvaniaNews