Maj. Gen. Robert Livingston identified the three killed as 1st Lt. Ryan Rawl of Lexington, 30; Sgt. 1st Class Matthew Thomas of Easley, 30; and Spc. John Meador of Columbia, 36.
Livingston, the state's Adjutant General, would not identify the five wounded.
All eight were serving with the 133rd Military Police Co., based in Timmonsville. The unit was activated last year and due to return home in August.
"These men died serving their country and I want to express my deepest sympathy and condolences to their families, who are the unsung heroes of our war effort," Livingston said in a statement. "These deaths are grim reminders that our military, to include our South Carolina National Guard, is still in active defense of our country. We are privileged to have such heroes in our midst."
Livingston says the suicide bomber attacked the soldiers Wednesday in the city of Khost, about 90 miles southeast of the Afghan capital of Kabul. The attack claimed 21 lives in all. The assailant detonated his explosives in the packed marketplace as he approached Afghan and U.S. soldiers at the traffic control point, said Baryalai Wakman, a spokesman for the Khost provincial government.
In a separate statement, Gov. Nikki Haley said she and her husband, Michael, were deeply saddened by the news. Michael Haley is an officer with the South Carolina Army National Guard.
"This tragic news is a constant reminder that our men and women in uniform and their families deserve our thanks each and every day," Haley said. "We continue to pray for the recovery of the injured and the families of the lost, and South Carolina will now put all of our focus on helping them going forward."
Livingston said the deaths were the first connected to a South Carolina Guard unit in Afghanistan since October 2010, when Staff Sgt. Willie Harley of Aiken and Sgt. Luther Rabon Jr. of Lexington died in Paktika province when their vehicle struck a roadside bomb.
Rawl had served with the Richland County Sheriff's Department since 2005, according to Sheriff Leon Lott.
"Rawl was willing to stand up to protect and serve; it was with that same pride he did so in his military uniform. He was an example to men and women who wear the uniform everywhere," Lott said in a statement.
Rawl graduated from The Citadel and worked as a patrolman and later as a resource officer at Crayton Middle School in Columbia.
Livingston said the mission of the South Carolina unit was to train members of the Afghan police.
The unit deployed 170 soldiers to Afghanistan in November 2011.
Livingston said 16 members of the South Carolina National Guard have died in combat operations in Afghanistan and Iraq since 2003.
Nearly 1,900 U.S. troops have been killed in Afghanistan since the war began more than a decade ago.