Several hundred people lit candles and sang “Amazing Grace” during a vigil in memory of four sheriffs deputies in remote southwest Virginia who were shot by a sniper with a high-powered rifle, leaving two of them dead.

The 20-minute memorial was held outside the Buchanan County Courthouse in Grundy. Sheriff Ray Foster sobbed and thanked a man who shouted support for the fallen officers.

Photos of the four deputies were placed on a table with candles and two crosses.

Funerals are planned later this week for the two slain officers, Cameron Justus and William Stiltner. The two other officers remain in critical condition.

Police killed the gunman when they closed in on him and they said he pulled out a pistol.

Authorities are investigating what sparked the violence.