KANANASKIS, Alta. -- Conservation officers say a bear that seriously injured two hikers in a southern Alberta park retreated after biting into a can of bear spray that one of the people was holding.

Officials with Alberta Parks said a Calgary woman and her adult son were hiking in Peter Lougheed Provincial Park on Saturday afternoon when the bear came out of the forest a few metres in front of them.

"The hikers surprised a bear at close range near a carcass and it resulted in a defensive attack," said Arian Spiteri, district conservation officer in Kananaskis.

It's unknown whether it was a black bear or a grizzly, but she said they suspect it was a grizzly.

"The bear made contact with the first hiker, knocking him to the ground twice," she said. "He suffered wounds to his face, his head and his arms."

Spiteri said the woman had dropped her bear spray, but she was able to pick it up again and was about to spray the aerosol deterrent when the bear bit her hand and the canister.

"At that point, the bear spray deployed in the bear's face -- from the holes that were created when it bit the canister -- and the bear retreated."

She said the hikers were able to drive themselves to the Canmore hospital, where they were treated for bites and scratches before being released.

Officers evacuated the area and closed several popular hikes in the Spray Valley until further notice.

"We're closing this area to give the bear space and allow it some time to recover from the encounter," she said. "From the bear's perspective, this would be quite a stressful encounter as well."

Spiteri said bear attacks are rare in the park, but hikers should always be prepared for an encounter by hiking in groups of four or more, making lots of noise, watching for signs of bear activity and carrying bear spray.

They also recommend not wearing ear buds and keeping dogs on a leash at all times.