A woman was able to fight off a serial stalker with her handbag after she allegedly found him performing a lewd act in her Sydney unit block.

Police allege the man was performing a sex act and later grabbed the woman by the shoulder when she returned to her Auburn home on Wednesday night.

He had allegedly stalked the woman at her work and her home a few days prior.

The woman, 27, told police she was getting out of the lift at her Queen Street unit block when she saw the man playing with himself.

She ran towards her unit door but the stalker allegedly grabbed her shoulder.