PORTLAND — Portland police have identified the man whose body was pulled out of the harbor Monday night.

Lt. Gary Rogers said in a statement released this afternoon that 45-year-old James Stewart, a transient, was the man pinned under a floating dock near 72 Commercial St. Firefighters had to use a chainsaw to remove floor planks from the dock in order to pull him out of the water.

An autopsy conducted by the state Medical Examiner’s Office concluded that Stewart died of accidental drowning. Stewart drowned in an area behind the Dry Dock Restaurant and Tavern, Gilbert’s Chowderhouse, and the Porthole Restaurant.