However, the offender "dismissed the victim's claims to need help", police said, and the two witnesses walked away from the scene.
The woman then tried to get help from a nearby house, but was assaulted again.
This time, another member of the public witnessed the assault and shouted for the attacker to stop, police said. The woman then ran to that house and the occupant phoned police.
But as the occupant was on the phone, she left the house to try to find her mobile phone, and "the offender has then continued to assault her".
The attack lasted until police arrived on the scene, and the alleged offender was arrested.
"Police would like to hear from the initial two members of the public who came into contact with the victim on Harbour Tce, or anyone else who may have witnessed the assault," police said today.
• Anyone with information on who the two people were, or who has any information about the assault, is asked to contact Constable Allen Wilson at the Dunedin Central Police Station on 03 471 4800, or anonymously contact Crimestoppers on 0800 555 111.