ANCHORAGE, Alaska (AP) — A man riding his bicycle to work Tuesday on a city trail was attacked by a grizzly bear, which swatted his ear and bit him on the leg, police said.

Sean Berkey encountered the bear on the east end of Rover's Run trail at 5:30 a.m. as he headed to work at the Alaska Native Medical Center, where the 45-year-old works as a pediatric pharmacist. He had crossed a wooden bridge when he surprised the sow, who had a cub with her.

Berkey stopped his bike, and the bear charged. He momentarily used his bike as a shield, said Bruce Bartley, a spokesman for the Alaska Department of Fish and Game.

Berkey played dead — the accepted practice when attacked by a brown bear — and then tried to get away, but the sow came after him again, so again Berkey played dead.

"The bear swatted him and bit him once," Bartley said, describing the injuries as "fairly minor."

Berkey eventually got back on his bike and rode to the hospital where he was met by a police officer, said Anita Shell, an Anchorage police department spokeswoman.

Berkey declined an Associated Press request for comment through the Alaska Native Medical Center. Hospital spokeswoman Fiona Brosnan said he did not want to talk about the attack.

It will be up to the municipality to decide whether to close the trail. It was closed two summers ago after a number of serious bear attacks on Rover's Run, including one in which a 15-year-old girl competing in a bike race suffered a crushed skull and almost died.

Sarah Erkmann, spokeswoman for Anchorage Mayor Dan Sullivan, said at this point closing the trail is not being considered. She said bear warning signs have been posted along the trail route.

Bartley said he doubted there would be any serious consequences for the bear in this case given that it was a sow that was surprised by the bicyclist and was defending her cub.

"By this guy's account, this was absolutely a bear being a bear," he said. "He stumbled on to a sow with a cub at close quarters."