Jesse Mansir, 31, of Gardiner, was taken into custody after 7 p.m. and charged with robbery, Chief James M. Toman of the Gardiner Police Department said in a release.

State police and the Kennebec County Sheriff's Office assisted in the search, with two K-9 teams participating and a total of 15 officers involved.

The search began around 5 p.m. when investigators concluded that Mansir was hiding in a woods area off Harrison Avenue in Gardiner, Toman said.

Police had identified him as a suspect following the 10:35 a.m. robbery of the Rite-Aid pharmacy on 9 Spring St. A man handed a note at the pharmacy that made reference to a gun, but none were displayed, Toman said.

After getting drugs, the man was last seen headed to Spring Street. Toman said no one was hurt in the robbery.