LOS ANGELES (Reuters) - A 7 foot (2 meter) great white shark bit a swimmer off the coast near Manhattan Beach in Southern California on Saturday, leaving the man with moderate injuries, a fire department official said.

The shark bit the long-distance swimmer in the upper torso and immediately released him, said Inspector Rick Flores, a spokesman for the Los Angeles County Fire Department, which provides lifeguard services in the area.

The man was taken to a local hospital and was breathing and alert with a moderate wound, Flores said.

Lifeguards barred swimmers from entering the water for a mile-long (1.6 km) stretch around where the attack occurred, and watched the shark until it swam further out into the ocean, he said.

Shark attacks are rare in ocean waters off Southern California, and the last fatal attack anywhere along the state happened in 2012 when a great white bit a surfer near Vandenberg Air Force Base in Santa Barbara County.

In the latest incident, a fisherman standing on a nearby pier had been battling the shark on a line for more than 30 minutes when he saw it bite the swimmer, Flores said.

The fisherman cut the line when he saw it had bitten the swimmer, Flores said. Manhattan Beach is a community about 5 miles (8 km) south of Los Angeles.

People fishing in Southern California are occasionally known to hook smaller great white sharks.

(Reporting by Alex Dobuzinskis; Editing by Diane Craft)