The dramatic scene in Venice was caught on camera.
Melora Rivera said she was in bed at the time of the break-in.
Still wearing only a flannel shirt, she grabbed her phone and ran towards her second-storey window and hid on the roof.
But the intruder ran after her and came dangerously close.
Ms Rivera hid under an eave as she called 911.
Police arrived minutes later, along with firefighters who helped Ms Rivera down from the roof.
"I'm shocked, and pleased at myself for reacting so quickly," she told KCAL 9 TV. The suspect has been held and identified as Christian Hicks, 29, and reports said he is a mentally ill, homeless man.
He has been taken into custody and charged with burglary.