Agents from the Maine Drug Enforcement Agency and local officers arrested two men in Southwest Harbor and charged them with distributing heroin last week, the MDEA said in a statement.

After an investigation that spanned several months, drug agents executed a search warrant last week at 258 Main St. When police arrived, two men fled the home. A police dog found one man, Andres Martinez, also known as “P,” 42, of Hudson, New Hampshire, in nearby woods.

The second man, identified as Ian Jellison, 35, of Southwest Harbor, turned himself in June 16.

About $1,500 in cash and an unspecified amount of heroin were seized from the house. Both men have been charged with trafficking a schedule W drug, a Class B felony. Bail for Martinez was set at $25,000 cash. Bail for Jellison was set at $3,000 cash.

Both men are scheduled to appear in Hancock County Unified Court Aug. 12.