The body of a missing Scarborough man was recovered from Portland Harbor Wednesday morning.

Portland police say the body of Matthew Foster, 23, was spotted by witnesses in the water between Union Wharf and Widgery Wharf around 5:20 a.m. Wednesday. Foster’s body was removed from the water by the Portland Fire Department and taken to the Office of the Chief Medical Examiner, police said.

The medical examiner will investigate the cause and manner of death, according to police.

Early Wednesday, police had put crime scene tape up around the area where the Portland Fire Department’s boat is docked near the ferry terminal.

Police last week spent several days searching the waterfront for Foster. Police dogs tracked his scent to the waterfront, where cadaver dogs indicated there was a body in the water. The search was suspended on June 17.

Foster was last seen June 10 in the Oasis nightclub on Wharf Street. He was in the bar just before midnight and was expected to meet friends later, according to police. Police said video surveillance footage was used to confirm Foster was in the area of Wharf Street.

Foster was an employee of C.B.S. Lobster and Bait, an employee said. He had worked at the Union Wharf business for about two years.

Foster’s case parallels that of James Dyer, 23, of Saco, who was reported missing from the Old Port on New Year’s Eve when he got separated from his friends as they searched for their car near the waterfront. Dyer’s body was found in the water nearly two months later.