CNN  — 

Seven law enforcement officers were shot, one fatally, during a standoff Wednesday in Florence, South Carolina, city police Chief Allen Heidler said.

Florence County Sheriff’s deputies were executing a search warrant when a man opened fire, said Maj. Mike Nunn, a spokesman for the sheriff’s office. The man then barricaded himself in the home with children during the two-hour standoff, Nunn said.

The other officers were shot as they responded to assist their fellow officers, authorities said.

“These officers went there unknowing the firepower this suspect had. … They thought it was a random search warrant,” Florence County Sheriff Kenney Boone said.

He said the suspect was in custody.

Boone said: “Fire was being shot all over. The way the suspect was positioned, his view of fire was several hundred yards. So, he had an advantage.”

Authorities direct traffic near the shooting scene.

Three Florence officers and three deputies were wounded in the standoff, Heidler said. Their conditions were not immediately known.

The deceased officer was identified as Terrence Carraway, city of Florence spokesman John Wukela said.

Carraway was an officer with the Florence Police Department. He had recently received a pin commemorating 30 years of public service, Wukela said.

“Today will mark a very horrific day in the annals of the Florence Police Department,” Heidler said. “Today, we lost a good friend of mine, an officer that I’ve known for 30 years.”

“Pray for the family who lost the bravest police officer that I have ever known,” the Florence police chief said.

President Donald Trump and South Carolina lawmakers also offered prayers for victims.

“My thoughts and prayers are with the Florence County Sheriff’s Office and the Florence Police Department tonight, in South Carolina. We are forever grateful for what our Law Enforcement Officers do 24/7/365,” the President wrote on social media.

“This is simply devastating news from Florence. The selfless acts of bravery from the men and women in law enforcement is real, just like the power of prayer is real,” Gov. Henry McMaster said on a social media post.

CNN’s Melanie Schuman, Danielle Hackett, Diannne Gallagher, Betsy Klein and Lauren Leslie contributed to this report.