VANSANT, Va. — A gunman opened fire on sheriff's deputies investigating a possible robbery at a rural salvage yard on Sunday, killing two and injuring two others before being killed in a shootout, Virginia State Police said.

One of the Buchanan County deputies had life-threatening injuries and the other was in serious condition, state police said.

Buchanan County Sheriff Ray Foster called the shooting "one of a kind" for his department but declined to say anymore.

The owner of Roger's Service Center in the southwestern Virginia community of Vansant told police that his business was being robbed and he had blocked the suspect's vehicle with his own.

State Police Sgt. Steve Lowe said when deputies and state police arrived about 2 p.m., someone started shooting at them from long range. Two deputies were hit and died at the scene.

The other two deputies were shot when they arrived at the salvage yard.

State police and other officers found the suspect about two hours later and after "some sort of engagement" they shot and killed him, Lowe said.

"I'm not sure what the confrontation was when they encountered him," Lowe said. "Apparently he was identified as the right person."

Lowe said he didn't know if the man fired on police, or if he was armed at the time.

State Police did not release the names of the deputies or the suspect and they may not be given until Monday.

Residents were asked to leave their homes shortly after the salvage yard shooting and several remained gone late Sunday.

"This is a laid-back community. Everybody knows everybody," said Tivis O'Quinn, 68, who has lived in Vansant for 40 years and operates a business less than a mile from the salvage yard. "Nothing like this ever takes place, except for the law school shooting."

In January 2002, a student opened fire on the Appalachian School of Law campus after learning he had failed out of school. The school's dean, a professor and a student were killed in the attack. Three other students were wounded. The shooter, Peter Odighizuwa, pleaded guilty and was sentenced to life in prison.

Vansant is a former coal mining town in the mountainous region of southwestern Virginia. O'Quinn said the community experiences "little petty thefts now and then," but nothing like what occurred on Sunday.

On display in O'Quinn's office was a 2011 calendar of the Buchanan County Sheriff's Department. The photograph features the department's 47 members, including Foster and 24 uniformed deputies.

According to the website The Officer Down Memorial Page, the last Buchanan County sheriff to die in the line of duty was in 1975 of a heart attack. The website lists four on-duty deaths for the department since 1905. The last by gunfire was in 1964.