NEWPORT, Maine — It took a handful of police officers and more than two hours, but a man who has been on the run from law enforcement for six months was captured and arrested Thursday.

Brandon Gould, 23, formerly of Hartland, was located Thursday morning at a Mill Street apartment, according to Newport Police Chief Leonard Macdaid. Macdaid and several officers went to the apartment and found two men and two women on a porch.

One of the men — Gould — went inside and escaped through a front window.

“We chased him for more than two hours,” Macdaid said. “It started on Mill Street, went down and around the old Hood plant, down to the [Sebasticook] river and back up to his apartment. We finally located him there underneath a mattress.”

Macdaid said Gould was convicted more than six months ago of a domestic assault in which he struck his pregnant girlfriend in the stomach with a baseball bat. After his conviction, Gould was given a stay of execution but while out of jail, he allegedly committed a burglary. He then additionally was charged with burglary, violations of the condition of his release and failure to appear.

“A statewide felony warrant was issued for him,” Macdaid said. Gould also was charged Thursday with resisting arrest.

Macdaid said the incident began when a probation officer received a tip as to Gould’s whereabouts. The Newport police were assisted by the Maine State Police in the search.

Gould is being held without bail at the Penobscot County Jail.