"They've found her in a very distressed state. They called for help and they did absolutely the right thing," he said.
"They handled what was a difficult situation in a very mature, responsible and empathetic way."
Mr Townsend said the woman was treated at hospital and was now recovering at home.
He said the woman did not know her attacker.
Police were collecting CCTV footage and wanted to speak to the driver of a grey Honda Odyssey car seen in the area at the time.
"It had a large Tongan flag attached across the bonnet. We need to rule that person out," he said.
Middlemore chief operating officer Jenni Coles said that while the attack was not on hospital grounds it was still "very concerning".
"We are actively reviewing anything we can possibly do to make the hospital environments safer for staff, patients and visitors," she said.
"We do have a security team and we are currently reassessing how they may be deployed."
Ms Coles said all visitors to the hospital, patients and staff should take extra care.
A safety message was put out across the hospital yesterday.
"Police are increasing their patrols of the area, particularly over shift changes when an increased number of staff may be walking to their cars," the message said.
"In addition, can I urge you all to please take extra care with your personal security.
"This means walking to your car in pairs or in groups, especially after dark.
"If it is very late, calling security who can accompany you to your car ... staying in well-lit areas outside the hospital [and] being alert and aware of what is happening around you.
"Please look after yourself and others.
"Take the same precautions with your personal security which you would in any city after dark."
The attacker
* Young Pacific Island male.
* Wore grey adidas hoodie, black beanie marked with red eagle.
* May have facial injuries inflicted by the victim.
Can you help?
* Contact Detective Sergeant Townsend on 09 353 0023
* Crimestoppers on 0800 555 111.
Information