A group of University of Florida students who traveled to South Africa for a 3-week outreach program were robbed at gunpoint on Monday, the university said.

The 19 students, a staff member, and a faculty member were on a bus on their way to a children’s school in a township near the city of Pretoria when they were ambushed by six armed gunmen, who had followed them in a vehicle after the bus had passed a security gate, a university spokesman told the media.

The group was robbed inside the gates of the school after being ambushed, according to student Maya Barret’s account of the incident on Facebook. She said the students tried to flee to a kindergarten classroom for safety.

“We are all safe and grateful to have walked away from the crime alive,” she wrote.

UF spokesman Steve Orlando said a group of local residents attempted to protect the students from the gunmen, who fired at the residents while they tried to flee. He said one local resident was grazed by a bullet while another was pistol-whipped.

The students, he said, gave first-aid to the injured locals. None of the students, the staff member, and the faculty member were physically injured.

“We’re just tremendously thankful that everyone is OK and grateful to the local residents who came to help our group,” he added in an email to the Gainesville Sun.

54 WOMEN AND CHILDREN RESCUED FROM BOKO HARAM, NIGERIAN MILITARY SAYS

The students met with counselors and U.S. Embassy personnel when they arrived back to the University of Pretoria.

The University of Florida students were in South Africa as part of a 3-week study abroad program at the University of Pretoria. (istock)

Lt. General Elias Mawela, of the South African police, said the American group was robbed of their personal belongings, including laptops, cellphones, cameras, passports and plane tickets. He said the gunmen “allegedly fired shots randomly when they were getting away.”

“This blatant disrespect for the law to a point of not caring about the safety of little children of this particular pre-school is a blatant attack on and undermining the authority of the State. Police will leave no stone unturned in ensuring that these suspects are found and brought to book," Mawela said in a statement.

SUDAN MILITARY AND PROTESTERS REACH AGREEMENT FOR THREE-YEAR TRANSITION PERIOD

Barrett said she was thankful for the outpouring of support after the ordeal and that she doesn’t blame the school, the program or the people of South Africa.

“This could have happened anywhere, and was not specific to this community,” Barrett wrote. “In fact, tremendous kindness was shown by community members as they comforted and protected us after. We had people hugging us, feeding us, and apologizing even though they had no fault.”

She added: “South Africa is a beautiful place with beautiful people…. Fear of the unknown is not a good enough reason to not see and experience the world.”

CLICK HERE TO GET THE FOX NEWS APP

Orlando said the majority of the students will remain in South Africa for the remainder of the trip. Three students are making plans to return to the U.S.

“We’re so thankful that everything turned out the way it did, aside from it obviously being a very terrifying and traumatic experience. Thankfully everybody’s physically OK,” he said, adding that they will be evaluating the program and location moving forward.