A 90-year-old grandmother and her granddaughter have been viciously attacked while withdrawing money from an ATM in Perth’s south.

A Fremantle magistrate granted 9News exclusive access to CCTV footage of the incident, after sentencing Troy Andrew Sargent to 11 months behind bars this week.

The security footage shows the 36-year-old behaving bizarrely in the lead-up to the assault.

He can be seen reaching towards 90-year-old Carmen's back pocket as she withdraws money from the machine, prompting her worried granddaughter to approach and ask if he'd taken her money.

It's then that Sargent snaps.

The vision shows Sargent sucker-punch 29-year-old Jacqui in the face before delivering a fly-kick to her back, causing a domino-effect.

Jacqui is sent hurtling into her grandmother, who falls backwards, her head smacking the pavement.

The court heard Sargent "thought the women were witches who'd used sorcery to rob him". (Supplied)

The court heard the assault could have killed Carmen, who needed stitches and suffered two black eyes when the attack unfolded at the Kardinya ATM in March.

The court heard the paranoid schizophrenic thought the women were witches who'd used sorcery to rob him, and that the assault was part of a three-day rampage while off his medication.

He also chased his Spearwood neighbour with a metal pole and punched a Fiona Stanley hospital worker.

The magistrate was sympathetic of the Sargent's mental illness but still put him behind bars, deciding that monitoring him in the community hadn't been effective.

His victims are already worried for when he's released.

"I couldn't believe it was happening and then I was knocked out, my head on the pavement and I couldn't remember much," Carmen said.