This is why it always pays to be prepared.

Two hunters in Idaho recently survived an encounter with a bear, and officials have credited the duo’s survival to the fact they came prepared with anti-bear equipment.

An archery hunter was attacked by a bear but survived after spraying bear spray.

An archery hunter was attacked by a bear but survived after spraying bear spray. (iStock)

The pair (whose identities have not been released) was out archery hunting in a remote area in the Caribou-Targhee National Forest when they came into close contact with the bear, according to Idaho Department of Fish and Game. While it has not been confirmed by officials, the duo described the animal as a grizzly bear.

One of the men was reportedly knocked to the ground by the animal and sustained injuries.

WISCONSIN GIRL, 11, HARVEST BLACK BEAR WEIGHING OVER 700 POUNDS, IS HOPING TO TAKE STATE RECORD

Fortunately, both hunters were reportedly carrying spray at the time, and were able to deploy it, causing the bear to flee the area. Both hunters walked themselves out of the area, although the injured hunter was transported to a nearby hospital by ambulance once the duo was able to call for help.

CLICK HERE TO GET THE FOX NEWS APP

Officials have credited the hunters’ preparedness for shortening the duration of the attack and preventing the incident from having a tragic ending. Signs have since been placed in the area to warn other hunters of bear activity.

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

This is the third reported grizzly bear attack in Idaho this year, Idaho Statesman reports. A hiker reportedly survived being bitten by a female bear in May near Henrys Lake, and two hunters reportedly came across a mother bear and her cubs last week near Sandpoint. Both deployed bear spray and survived the encounter.