A man who fell off a dock at the Maine State Pier in Portland on Wednesday was rescued by the captain of a Casco Bay Lines ferry, who dove off a dock into icy Portland Harbor to drag the man to safety.

John Tracy, who has worked for Casco Bay Lines for 29 years, said he and several other employees heard someone crying out for help around 2:45 p.m. near the Maine State Pier, which is next to the Casco Bay Lines ferry terminal.

“We thought it was a fight at first before we realized someone was in the water,” said Tracy, who retired from the Coast Guard Reserve last year and considers himself a strong swimmer. “I grabbed a life ring with a line attached to it and went to see what was going on.”

The man, whose name is not being released, had been standing on a floating dock below the pier with another man. Deputy Fire Chief Robert Thompson said the man apparently fell backward into the water from the dock. “There is a chance that alcohol may have been involved,” he said.

Thompson said Tracy dived into the harbor and swam to the man, who had difficulty holding onto a life ring that Tracy threw to him. “It could have been a very different outcome if (Tracy) had not gone in,” Thompson said.

Tracy, 50, who lives in South Portland, said it was becoming obvious that the man would not be able to pull his arms over the top of the life ring, and that he was at risk of drowning. The Coast Guard said the water off the Maine State Pier was 47 degrees on Wednesday.

“He was trying to get the life ring on, but his head kept getting lower and lower,” Tracy said.

Tracy dove off the dock and swam about 20 yards to the man. “He wasn’t very coherent,” he said.

Tracy said he got one of the man’s arms over the life ring. That allowed people on the dock to pull in Tracy and the man, using the rope attached to the life ring.

“It was a calculated risk on my part, but I guess the adrenalin kicked in,” Tracy said.

A team of medics from the Portland Fire Department cut the man’s clothes off and wrapped him in a blanket before taking him to Maine Medical Center with non-life threatening injuries

Gene Willard, another ferry captain, took photographs of the incident and provided them to the Portland Press Herald. Willard was heading out on the Maquoit II for the mailboat run to Little Diamond Island. He said Tracy may have saved the man’s life.

Tracy said he had to laugh at himself after the rescue.

“I can’t remember the last time I went swimming in the ocean,” he said.