A Colorado man survived a bear attack in the backyard of his home when he fired at the animal and scared it away after it threw him to the ground, state wildlife officials said.

The attack occurred Saturday night in the small town of New Castle, Colorado Parks and Wildlife area manager Kirk Oldham said in a news release.

The man went into his backyard after hearing a noise and encountered the bear, which threw him to the ground, officials said. He then threw up his an arm to protect his face while grabbing a gun with his free hand and firing three shots, they said.

COUPLE SPOTS RARE WHITE ‘GHOST’ MOOSE CROSSING HIGHWAY

It’s unknown whether the bear was hit by the bullets.

The man told Parks and Wildlife that he had seen the bear in his yard the previous two nights.

Bear in tree

A bear takes refuge in a cottonwood tree along Goose Creek Path in Boulder, Colorado, on Sept. 25, 2015. (Photo by David Jennings/Digital First Media/Boulder Daily Camera via Getty Images)

Heavy rain made it difficult for Parks and Wildlife officers to find and follow a blood trail and bear tracks as they searched for the animal, the news release said. They were still searching Monday.

The man, whose name was not released, was treated at a hospital for minor injuries to his hand and arm, and bruising on his chest, the release stated.

MOOSE SPOTTED BY POLICE RUNNING THROUGH BOSTON SUBURBS

It's the second bear attack in the western Colorado town in the last three months as bears prepare for hibernation, Oldham said.

In August, a bear charged a woman and swiped at her, lacerating her arm and back. The woman recovered, and a mother bear and cub were euthanized, The Denver Post reported.

MARYLAND MAN WINS $4.4M FOR REELING IN 77.5-POUND WHITE MARLIN

"This is an unfortunate reminder that we need to be vigilant and ‘bear aware’ at all times," Oldham said in the news release.