A cougar crashed through a glass door to try to eat a tiny dog—and ate a face full of bear spray instead. The attack took place late last week in the basement bedroom of a three-story mountain home near Santa Barbara, California. “[It was an] unbelievable, unreal situation,” the homeowner Ted Adams told Noozhawk. “[The cougar] was a good-sized animal. It wasn’t a youngster. It was a big cat.”

Adams, who’s lived in the Painted Cave community above Santa Barbara since 1967, was being visited by his sister Lee Larsen, who brought her dog, Buddy, with her. On the evening of Wednesday, December 22, Buddy, a 25-pound mixed breed, barked repeatedly at a basement door. Larsen checked on the dog but didn’t see anything unusual and returned upstairs. Then there was a huge crash from downstairs. The wild cat had charged inside the house, shattered the glass door, and snatched Buddy up in its mouth. After seeing the cougar, Adams went for his gun and ammo in an upstairs safe. His wife, Tracy, was faster. She went for bear spray.

“Tracy went over and gave it a full blast in the face,” Adams says. “The lion lost interest in the dog and got very interested in Tracy, so she nailed it again.” Tracy was about 6 feet away from the big cat when she deployed the bear spray. The cougar leapt out of the house and ran away. Larsen rushed Buddy to the vet for treatment.

“I just picked Buddy up from the vet in Santa Barbara,” wrote Larsen in a Facebook post the day after the attack. “He suffered multiple lacerations on his neck and throat that had to be stitched up, and the lion shook him quite a lot, which resulted in a very sore neck, and possible disc problems. It’s a Christmas miracle that we still have him alive here with us.”

Read Next: Lap Dog Stares Down Mountain Lion in Colorado Backyard

According to the California Department of Fish and Wildlife, the state’s cougar population is between 4,000 and 6,000 animals. Cougars are not federally protected, but it is illegal to kill or injure them in California under state law, where they have been considered specially protected mammals since the California Wildlife Protection Act of 1990. There are three exceptions in the state that allow for the taking of a cougar: by permit for livestock predation, to preserve public safety, and to protect bighorn sheep populations.