A seven-year-old South African boy was shot and wounded while on his way to his first day of school on today in a suburb outside of Cape Town plagued by gang violence, police said.

The first grader was accompanied by a 17-year-old boy when a gunman opened fire on them in the Elsies River suburb around 1110 IST. Both were wounded.

"The boy was on his way to school when shots were fired," police spokesman Andrew Traut said.

A 27-year-old man has been arrested in connection with the shooting and will appear in court tomorrow on attempted murder charges.

The populous and poverty-stricken eastern outskirts of Cape Town, known as the Cape Flats, are notorious for shootouts between gangs, with school children regularly caught in the crossfire. Last year, sixteen schools were shut for two days as violence flared in the area.

The police have created safety corridors for children to walk to school while police officers have been stationed at the hardest-hit schools.

Between 2007 and 2011, 532 murders took place in five gang hotspots in Cape Town, according to police statistics.

The provincial government has repeatedly demanded that the army should be sent in to the restive area, but the calls have been dismissed by the national government.