Three police officers were killed and two others critically injured in a shooting in the US state of Pennsylvania, while following up on a 'domestic-related' investigation, authorities have said.

Pennsylvania State Police Commissioner Colonel Christopher Paris stated that the gunman was fatally shot by the police. The incident occurred just after 14:00 local time (18:00 GMT), with images showing a police officer being airlifted in a medical helicopter.

Due to the shooting, a nearby school district in Spring Grove, a small town of around 2,500 residents, was briefly put on lockdown, although officials later confirmed that the school was unaffected.

Authorities assured that there was no active threat to the public following the incident that took place in rural York County in North Codorus Township, situated about 100 miles (160km) west of Philadelphia. Officers had been present for an investigation initiated the previous day.

Pennsylvania Governor Josh Shapiro visited the area in the afternoon and met with the families of the fallen officers. 'We grieve for the loss of life of three precious souls who served this county, served this commonwealth, served this country,' Shapiro stated.

In response to the tragedy, he ordered all state flags to be flown at half-mast in honor of the slain officers.

Shapiro emphasized, 'This kind of violence is not OK; we need to do better as a society.'

FBI Director Kash Patel confirmed that agents were providing support to local and state partners in the aftermath of the shooting. 'Our prayers are with the officers, their families, and the entire York County community,' he added in a statement.