An elderly woman was pelted with human faeces after withdrawing cash on Sydney's north shore and then robbed by a man who came to her help, police say.

Police suspect the attacker and the thief may have been the same person.

The 85-year-old victim had just withdrawn cash from an ATM at Chatswood yesterday afternoon when she was hit from behind by human excrement.

A stranger then came to her aid and accompanied her to a toilet to wash herself clean.

But instead of helping her, the man reached into her handbag and took her wallet which was stuffed with cash, police said.