ATLANTA — Seven law enforcement officers were shot — at least one of them fatally — in an extraordinary barrage of firepower after the authorities sought to serve a search warrant in South Carolina on Wednesday, officials said, transforming a residential subdivision into a tragic battleground.
The episode, punctuated by evacuations in a tactical vehicle and a protracted standoff between a barricaded suspect and the authorities, was among the American police shootings with the greatest bloodshed in recent years.
“They thought it was a random search warrant,” Sheriff Kenney Boone of Florence County, S.C., said at a news conference on Wednesday night, when he and other local officials appeared distraught. “But when they arrived, gunfire started.”
Although many details about the episode — including the reason for the warrant, the precise sequence of the fatal encounter, and the identities of the suspect and all of the wounded officers — were unclear on Wednesday night, the local authorities depicted an afternoon of chaos in the Vintage Place subdivision in Florence, a northeastern South Carolina city of about 37,000 people.
Maj. Mike Nunn of the sheriff’s office said that deputies had tried to serve a warrant at about 4 p.m., but that a suspect had opened fire, wounding three. Other law enforcement officers responded, including four city police officers who were soon wounded. The officers were eventually rescued from the scene in a military-style vehicle.
“Fire was being shot all over,” the sheriff said. “The way the suspect was positioned, his view of fire was several hundred yards. He had an advantage.”
In an interview on Wednesday night, State Senator Hugh K. Leatherman Sr., who represents part of Florence County, said he had been told that the suspect had used “a high-powered rifle” and that he had first opened fire from the second floor of the home.
Mr. Leatherman, the president pro tempore of the South Carolina Senate, added that the attack “had to be deliberate.”
The authorities did not immediately identify the types of weapons used in the exchange but said that all of the wounded officers had been injured by gunfire.
The suspect, who barricaded himself with children for about two hours, was in custody on Wednesday night, and the surviving officers and deputies were being treated at a hospital. Their conditions were not announced.
Chief Allen Heidler of the Florence Police Department said he had known the deceased officer — “the bravest police officer that I have ever known” — for about 30 years. A city spokesman identified the officer as Terrence Carraway.
Local officials signaled that the suspect had acted alone and said that the situation posed no further danger, easing worries in a community where emergency management officials warned just before 5 p.m. that there was “an active shooter incident in progress” and told people to stay away from the area.
A little more than than an hour later, the agency said that the situation was “over and the suspect is in custody.”
Elected officials, including Gov. Henry McMaster, swiftly expressed their condolences over the episode, the latest blow to a region already reeling from Hurricane Florence.
“This is simply devastating news from Florence,” Mr. McMaster wrote. “The selfless acts of bravery from the men and women in law enforcement is real, just like the power of prayer is real.”
In a post on Twitter, President Trump said he was “forever grateful for what our Law Enforcement Officers do 24/7/365.”
It is somewhat unusual, but not altogether rare, for multiple officers to be wounded in a single event.
In July 2016, five officers in Dallas were fatally wounded when they were ambushed. Days later, six law enforcement officers were shot, three fatally, in Baton Rouge, La., and in November of that year, two more officers were ambushed in Des Moines.
And two police officers, Cpl. Zach Moak and Patrolman James White, were killed in Brookhaven, Miss., on Saturday, several years after another south Mississippi city, Hattiesburg, lost two officers in a day.
The officer who died on Wednesday in South Carolina was the first in the state to succumb to gunfire since January, when a sheriff’s detective was killed in York County. Three others were wounded in that episode.
“Everybody’s sort of in shock,” Mr. Leatherman said on Wednesday. “The outpouring from our community to the victims and families of the victims is absolutely what you would expect from a Southern city.”
Alan Blinder reported from Atlanta, and Andrew R. Chow from New York. Matt Stevens and Melissa Gomez contributed reporting from New York.