Tyler Malmstrom, an inmate who left behind a written apology when he escaped from a Belfast detention center two weeks ago, was arrested Friday in South Boston.

Malmstrom was arrested about 4:30 p.m. Friday by officers with the Boston Police Fugitive Unit. Police said Malmstrom was spotted leaving an apartment building near Hyde Park and was arrested without incident. He had outstanding warrants in Massachusetts along with Maine warrants for escape and failure to appear on a domestic assault charge for an incident in Sanford on May 4.

Malmstrom, 23, escaped from the Maine Coastal Regional Re-enter Center on July 10 when he left a recreation yard without permission. He left behind a note for Waldo County staff members, the courts and his family, apologizing for his actions.

He had been sent to the center to serve the final five months of his sentence for an assault during a bar fight in Knox County.

The arrest was announced by Sanford police. Malmstrom has family in the Sanford area, and police said detectives from Sanford had been working with Waldo County sheriff’s deputies in attempting to locate him. Sanford police contacted their counterparts in Boston after learning he might have gone to Massachusetts.