A black bear attacked a napping woman. She smacked it away with her laptop.

A Southern California teenager survived a bear attack using the only tool she had at her disposal: a laptop.

The 19-year-old, who remains unidentified but lives in Sierra Madre — around 20 miles northeast of Los Angeles — was napping in a chair at her backyard Monday evening. A black bear approached her, and suddenly struck, scratching at her arms and legs and biting her.

As she was being attacked, California Fish and Wildlife Capt. Patrick Foy told USA TODAY, she grabbed her laptop and smacked the bear with it.

"She managed to break free of the bear enough to run back inside," Foy told USA TODAY. She suffered minor injuries to her arms and legs, none of which is life-threatening.

The attack, Foy explained, was "100% unprovoked."

Bears aren't uncommon in the area, which is in the foothills of the San Gabriel Valley. Unprovoked attacks, however, are rare, according to Wise About Bears, a Canadian advocacy group for black bears.

When faced with an attack from a black bear, Foy said, "the unequivocal answer in California is to fight back."

"The recommendation to play dead is in the incident of grizzly bears," he said, which do not live in the state.

Two bears — a sow and her cub — were captured Tuesday night by the Department of Fish and Wildlife, but neither of their DNA matched up with swabs taken of the woman's bite mark. Officials planned for both bears to be tranquilized and taken to Angeles National Forest.

The cub, Foy told USA TODAY, inadvertently died due to complications from the tranquilizer; its mother was transported to the forest safely.

Follow Joshua Bote on Twitter: @joshua_bote

This article originally appeared on USA TODAY: Sierra Madre, California woman fends off black bear attack with laptop