It is a doggone good tale with a happy ending.

On Friday, a Coast Guard crew narrowly rescued a yellow lab who ventured too far into the ocean at Doran Beach.

"He was 400 yards off shore and unsure of which direction to go. He was extremely disoriented and he swam way off shore," said Matthew Foussadier, a Coast Guard boatswain's mate.

"We were a little apprehensive," Foussadier said. "When you do encounter an animal in distress, they can be resistant, but this dog was more than happy to get out of the water."

The drama began at 10:38 a.m., when the Coast Guard station in Bodega Bay received a call of a dog in trouble.

Buddy, a 2-year-old lab belonging to the Samran family of Elk Grove, was taken to the edge of the water by the dad, Jay Samran.

"The owner said the dog was playing in sand and had sand in his mouth, so he took him off the leash and he ran into the water," Foussadier said. "They are water dogs."

The dog swam far from shore, however, and had been in the ocean for 40 minutes and struggling to stay afloat when an observer on the beach called the Coast Guard station at Doran, Foussadier said.

Foussadier, petty officers Delbert Wiggins and Andrew Peek and Seaman Marina Rodriguez took off from the station in a 25-foot Response Boat, the Coast Guard's smallest and fastest rescue craft.

Luckily, the conditions for a rescue were ideal.

"It is not too bad of a day, sunny and the seas were calm," Foussadier said. "If there was a day for this to happen, this is that day."

The crew was directed to the dog's location at the south end of Doran by Coast Guard Fireman Samuel Lapierre, who was in the station's watch tower.

It took only eight minutes, but the crew arrived just as Buddy seemed to have run out of strength and sank from sight.

"Peek reached in deep and grabbed the dog and pulled him on board," Foussadier said. "The dog was kind of flailing around. The dog was trying to jump back into the water, he was shivering, whining, and we wrapped him in a blanket and warmed him up."

The Samran family was waiting at the dock when the boat returned, and Buddy was straining at the leash to reach them.

It was a good outcome for all involved.

"This is the way the cases are supposed to go. It was flawless from beginning to the end," Foussadier said. "It is a great feeling to be able to pull the dog out of the water. It would have been horrible if he hadn't survived."