ALFRED, Maine — A burglary suspect who escaped from a New Hampshire jail and managed to evade a massive manhunt over five days had vowed revenge against his ex-girlfriend and her new boyfriend in Maine, law enforcement officials said Wednesday.

David Glenn Hobson, who was captured Tuesday evening near a grocery store in Rochester, N.H., near the Maine border, made his first court appearance Wednesday.

Hobson didn’t say anything Wednesday in a New Hampshire courtroom, where he was charged with escape. Bail was set at $500,000.

Officials say vengeance was the primary motivator that drove him to climb over a razor wire fence on Dec. 1 in the recreation yard of the county jail in Ossipee, N.H., where he was awaiting trial on a burglary charge. Police say Hobson sent a text message to his ex-girlfriend vowing revenge against her and her new boyfriend.

Hobson, 34, cut his neck on the razor wire, they said.

After his arrest, he was returned to the same jail from which he escaped, the Carroll County House of Corrections.

The U.S. Marshals Service, Maine State Police and other agencies had brought in heavily armed officers, tracking dogs and surveillance aircraft to search for Hobson.

Hobson, who was originally held on a burglary charge and had a string of similar convictions, stole a car in Wakefield, N.H., after his initial escape, authorities said. The vehicle was found abandoned on a logging road in Alfred, and blood inside confirmed investigators’ suspicion that Hobson was injured by the razor wire.

Homes belonging to Hobson’s relatives in the Alfred and Sanford areas in southern Maine, about 30 miles away from where he was captured, were searched and kept under surveillance.

His father was arrested on a hindering apprehension charge and accused of leaving a stash of supplies for Hobson. Investigators found medical supplies and other items in the woods behind his aunt’s home in Sanford, officials said.

In the end, Hobson’s arrest was made without drama. Hobson was unarmed and didn’t resist when he was captured by U.S. marshals near the New Hampshire grocery store, where he’d been picked up in a vehicle by a friend, officials said.

When Hobson escaped from jail, a corrections officer in the recreation yard saw him jump over the fence and radioed the control room. But Hobson had disappeared into the woods behind the jail by the time officers arrived, said David Sorensen, chairman of the Carroll County board of commissioners.

The only other inmate to escape from the 8-year-old Carroll County House of Corrections walked away from a farm crew in 2009, and was quickly apprehended, Sorensen said.

When asked if the commission had discussed any improvements to the jail, Sorensen said the board had discussed adding more officers and said two were already in the proposed budget. The jail has 29 corrections officers and 56 inmates, with space for as many as 140, Sorensen said.

Associated Press writer Kathy McCormack in Concord, N.H., contributed to this report.