The woman was shaken, but not injured from the attack, which happened after a man entered a staff entrance at the Leith House Rest Home in George St about 6am.
The man grabbed the 49-year-old woman from behind and they fell to the ground, Detective Senior Sergeant Steve McGregor said.
They struggled and she screamed, but he ran off as she turned to face him.
A police dog tracked him to a nearby shed, where he was found hiding.
The man was not known to the woman.
Rest-home manager Barbara Alderson said it was thanks to the quick actions of the staff that the incident was not worse.
They were all shaken by the attack, which appeared to have been opportunistic.
No residents of the home witnessed the attack, but most heard the screams and had the situation explained to them.
The home was particularly security conscious, Ms Alderson said.
All doors were locked and alarmed at night.
They had just been opened for staff to enter the premises when the incident occurred yesterday.
A man facing two indictably laid charges as a result of the incident appeared in the Dunedin District Court yesterday.
He was remanded in custody, with no indication as to plea, to December 4.
Daniel Jeffrey Greathead (35), farm worker, of Milton, is charged with burglary and aggravated assault.