A surfer was hospitalized after a shark bit him at a Northern California beach Wednesday afternoon, California State Park officials said.

The shark attack happened at about 5:18 p.m. at Big River Beach in Mendocino Headlands State Park, according to a statement from the parks service. 

Three off-duty lifeguards helped get the wounded man out of the water and provided medical aid, the statement says. Lifeguards reported the man had been bitten on both legs while surfing.

He was taken to a local hospital, and his condition was not publicly released. 

The incident prompted the parks service to close nearby beaches for Thursday and Friday as a precaution.

Visitors are reminded that sharks are a natural part of the coastal ecosystem and that interactions with humans are uncommon.Â