A mama bear was mauling a hiker — until she accidentally sprayed herself with bear repellent

A mama grizzly bear began to maul a hiker in Wyoming's Grand Teton National Park, but her attack was cut short when she accidentally sprayed herself with bear repellent.

While the bear was biting the hiker — a 35-year-old man from Massachusetts — he was holding on to a can of bear spray, pretending to be dead. And then he got lucky. The grizzly, who might have mistaken the canister for one of the man's fingers, chomped right into it. And the punctured can paid her back with a healthy squirt of pepper juice.

This caused the irritated bear to flee with her cub, allowing the injured man to call for help.

From CBS News:

The attack happened even though the victim was carrying bear-repellant spray and made noise to alert bears in the forest, the statement said.

Speaking to rangers afterward, the man said he came across a small bear that ran away from him. As he reached for his bear repellant, he saw a larger bear charging at him in his periphery vision.

He had no time to use his bear spray before falling to the ground with fingers laced behind his neck and one finger holding the spray canister.

The bear bit him several times before biting into the can of pepper spray, which burst and drove the bears away.

The man got to an area with cell phone coverage and called for help. A helicopter, then an ambulance evacuated him to a nearby hospital.

The trail that the man had been hiking on Signal Mountain was closed after the attack, according to CBS, with no word on when it will reopen.

Fortunately, park rangers said they will not pursue the bear, who was only defending her cub. Meanwhile, the man is "expected to make a full recovery."