A bicyclist in Cantwell, Alaska, survived an attack by what he estimated to be a 500-pound brown bear by kicking it after it attacked him. He escaped with only puncture wounds and lacerations, according to a dispatch from the Alaska Department of Public Safety. On October 20, the unidentified man was riding his bicycle alone along the riverbed of the Jack River near its confluence with the Nenana River when he spotted a bear 10 to 15 yards away from him—and it was already running toward him.

He jumped off his bicycle and began yelling at the bear in an attempt to scare it away. When it became clear that the bear was going to attack anyway, he fell to the ground on his back, covered his head, and kicked at the bear. The bruin chomped his lower leg, just below the knee, before quickly retreating into the brush. After the bear left the area, the man was able to walk to a highway about 400 yards away and call a friend for a ride to the hospital, where he was treated and released. He was carrying a firearm at the time of the attack but did not discharge it.

One of the cardinal rules of safety in bear country is to never surprise a bear: but what should you do when the bear surprises you? According to the Alaska Department of Fish and Game (ADFG), if a bear has clearly noticed your presence, it’s best to stand your ground and talk to it calmly to let the animal know you are human. If the bear still approaches, it’s time to get more assertive by raising your voice, creating loud noises, and throwing rocks or sticks. When surprising a bear at a close distance, as in this instance, the agency’s recommendation is to continue to stand your ground. Bears will often charge but stop just short of attacking. You should never turn and run when a bear charges.

Read Next: 2021 Has Been a Year of Brutal Bear Attacks—And the Worst May Be Yet to Come

In the rare incidence of an attack, there are two good options: play dead or fight back. The right choice depends on whether the bear is acting defensively or appears to be seeking food. If a bear is acting defensively, the best bet is to play dead by hitting the ground lying still on your stomach with your legs spread apart for stability while using your hands to protect the back of your neck. In the case of a prolonged attack or if the bear perceives you as food, it’s best to fight back while concentrating “on the bear’s face or muzzle with whatever you have on hand.” Or, you might be able to just use your feet, as this man did.