Two Baviaanspoort Prison inmates who allegedly stabbed and raped two female nurses at the prison on Sunday were weeks away from being released.
Graham Abrahams, correctional services spokesperson, said the two suspects - both in their early 20s - were serving short-term sentences and not considered dangerous.
"Both were serving short sentences for minor economic crimes and their release was due in a few weeks," he said.
The attack took place at about 2pm in the prison hospital while the two inmates were cleaning offices.
"The cleaning of offices was part of their rehabilitation programme."
"They were not considered a threat," Abrahams said.
The nurses, aged 35 and 52, are in a serious but stable condition in Montana Private Hospital.
They were rescued by colleagues after one of the women managed to activate an alarm, said Janky Aphane, a prison official who responded to the emergency call.
Aphane said the inmates had locked the office door to prevent the nurses from escaping.
"We broke the door down and overpowered the prisoners," he said.
Aphane and his colleagues disarmed the knife-wielding suspect and treated the women for serious stab wounds.
"We managed to administer first aid before the paramedics arrived," he said, adding that had the alarm not been activated, both nurses could have suffered fatal injuries.
"I don't think they would have been alive now if they had not managed to raise the alarm," Aphane said.
Speaking on Monday at the prison, Correctional Services Minister Ngconde Balfour again vowed to step up prison security.
"The safety of our staff is not negotiable. We will be implementing changes to our security immediately," he said.
In 2004 Balfour said security in prisons would be reviewed after the fatal shooting of Sammy Gomba, head of Pretoria C-Max Prison, by an inmate.
"An internal investigation has been launched into the incident in conjunction with the police," said Balfour.
The two suspects, who have been removed from the prison into police custody, are expected to appear in court shortly on charges of rape and attempted murder.
"We will definitely be acting to improve the security situation at the prison and such incidents must not be permitted to happen again," the minister said.
Unions have condemned the attack, saying weekend staff reductions in prisons are partly to blame.
Lesiba Seshoka, spokesperson for the Democratic Nursing Organisation of South Africa (Denosa), called on the government to strengthen prison security immediately.
"We have witnessed a high rise in the number of nurses being attacked in the course of duty, yet all we get are promises and nothing else," he said.
Seshoka said the department needed to review its decision to reduce weekend staff in order to curb overtime pay costs.
"This incident confirms concerns around the reduction of overtime staff and the issue of security is an important one for public servants," he said.
Police and Prisons Civil Rights Union (Popcru) spokesperson Pat Nsobi said correctional services had to be held accountable for the incident.
"This incident happened at a time when management has taken a unilateral decision to reduce personnel working over the weekend, consequently placing the lives of members at risk," he said.