Two would-be thieves who broke into a California home ran away in fear when they realized — after kicking the door in — the homeowner was actually home.

Andrea Leggett was taking a shower Wednesday morning when the incident unfolded at her home in Pleasanton, a city roughly 30 miles southeast of Oakland. She heard the commotion but wasn't sure what it was.

CALIFORNIA WOMAN RESCUED BY COPS WHO STOPPED HER ABDUCTOR OVER VEHICLE VIOLATIONS

"Half the house was shaking because of the way they were trying to force themselves inside the house," Leggett told KGO-TV of the break-in, which was captured on surveillance video.

Her husband, Darren, said he believes it was a random attack.

"When they saw me pull out to take my oldest to [school], they thought, 'Oh, they are gone. No one is there.' It's an empty driveway," Darren said. The couple's other son was still at home, waiting for a ride to school.

CLICK HERE TO GET THE FOX NEWS APP

Once Leggett realized what could be happening, she ran downstairs — at the same moment the men broke open the front doors. The men can be seen on surveillance video running away once they realize Leggett is home and screaming.

The situation has brought the community closer together, one neighbor, Sara Porter, told KGO. She said it's gotten "everyone talking, everyone getting a plan [together]. We exchanged cell phone numbers, we exchanged emails and stuff, so that we can just keep an eye out on what's going on."