The coastguard was called at 12.15pm yesterday to reports that the collie, which had gone missing on Friday night, had been spotted on the beach.
Its owners had attempted to lure the dog, called Red, back to safety, but he ran further into the sea.
A 999 call was made by passers-by who saw the owners trying to follow Red into the sea.
Fleetwood and Knott End coastguard teams were called to the scene, and RNLI Fleetwood launched both its inshore and all-weather lifeboats.
Red was spotted being tossed about by the roughs seas. He was swept onto the flooded sandbanks, where volunteers felt it was unsafe for the RNLI lifeboats to proceed due to the high waves in the area.
Instead, two coastguard rescue officers wearing dry suits, life jackets and safety lines went into the sea to attempt rescue.
They swam nearly 400m in rough seas and eventually reached the 'exhausted and almost lifeless' dog.
The two officers were pulled back to the shoreline with the collie, who was passed to the care of Lancashire fire and rescue service, who gave him oxygen due to the amount of sea water he had swallowed.
He was then rushed to a local vets for emergency treatment.
Red's owner, Sharon Haworth, of Green Dick's Lane in Pilling, said: "A Huge, huge thank you to the coastguard and fire rescue, me and Red are so grateful. You all do an amazing job.
"A big thanks also to the people who alerted me as to his whereabouts and helped us keep our eye on his location.
"Red was quite poorly when he arrived at the vets, his body temperature was lower then the minimum it should be for a dog, he had a lot of sea water in his lungs and was totally exhausted due to the time spent in the water.
"After a lot of care at the vets, they were more then happy for Red to come home."
A HM Fleetwood spokesman said: "What a great result and big thanks to all those concerned in this incident, RNLI Fleetwood and Lancashire fire and rescue. Without your help, this could have turned into a very sad conclusion.
"However, a very special mention must go to the two coastguard rescue officers from Knott End who entered the rough seas and swam nearly 400m to get hold of this dog and bring him back to his family.
"Thanks chaps, as most of us are dog owners it was excellent news that your hard and dangerous work during this incident was rewarded with good news."