The Cape Times reported that 3-year-old Lincoln Nimmerhuidt and his stepfather were walking to the doctor on Sunday to be treated for chickenpox when they passed the dog.
The dog ran out of Perseverance Secondary School, which it apparently guarded, grabbed the boy and tried to drag him to the school.
"It grabbed him by the back of the neck and would not let go of him. I threw myself on to it but it did not want to bite me," stepfather Uzent Links told the newspaper.
The toddler was admitted to hospital and underwent surgery for injuries to his head, face and body.
Police spokesperson Warrant Officer November Filander said the dog was put down by the Society for Prevention of Cruelty to Animals (SPCA).
A case of letting a dangerous dog stray was opened against the unnamed security company operating at the school.