Fred Shero, who won two Stanley Cups as coach of the Philadelphia Flyers, died yesterday in Camden, N.J., after a long battle with cancer. He was 65.

Shero coached the Flyers from the 1971-72 season through the 1977-78 season. His teams won the Stanley Cup in 1974 and 1975 and reached the final in 1976, losing to Montreal.

He left the Flyers to coach the New York Rangers from 1978 until November 1980, leading them to the final in his first season. He rejoined Philadelphia as a special consultant last season.

Shero coached more regular season games, 554, than any other Flyers coach, and had a record of 308-151-95. His record with the Rangers was 82-74-24. His .612 winning percentage is fourth best among NHL coaches.

"They called him Freddy the Fog, because he was kind of eccentric in a brilliant sort of way," said Flyers spokesman Rodger Gottlieb. "He was very innovative, but people didn't understand him a lot. He would say things that were kind of obscure. He was an enigma."

Shero was the first NHL coach to hire a full-time assistant, and he later worked with two or more full-time coaching aides.

He was born in Winnipeg. After high school, he played with the St. James Canadians of the Winnipeg Juniors. He later played for the old Cleveland Barons and then the Rangers in 1947-1948 and 1949-50.

Shero played the violin, boxed for 10 years and took a correspondence course in law. He also was known to spend a good deal of time in public libraries and reportedly was well-read in Shakespeare and Dickens.