A former Army scout who eluded law enforcement during a week-long manhunt across Bucks County last year has pleaded guilty to raping two young girls.

David Allen Hamilton Jr., 48, admitted his guilt on Tuesday, the day he was expected to go to trial in Doylestown. The Feasterville resident was sentenced to 10 to 20 years in prison for rape of a child, statutory sexual assault, indecent assault, and related offenses, according to court records.

Hamilton’s attorney, Sharif Abaza, said that Hamilton decided to forgo a trial, and that he agreed with that decision.

“I think the offer was a reasonable one, considering the charges,” Abaza said. “We were ready to go to trial, we had picked a jury, the commonwealth came with another offer, and he accepted it.”

During a preliminary hearing last fall, the victims said Hamilton assaulted them multiple times over five years, starting when each was 9. One girl, now 13, said Hamilton threatened her after the assaults, telling her to “be quiet and not say anything.” The other, now 15, said Hamilton also took explicit pictures of her inside a bathroom in his home.

Hamilton fled his neighborhood after police in Lower Southampton Township issued a warrant for his arrest last October.

The search for Hamilton captured headlines throughout the region. He roamed forests in the center of the county, at one point assaulting two officers who tried to take him into custody. He then stole a car belonging to a bedridden woman being cared for by a former girlfriend, and fled to a Delaware County home owned by one of his relatives.

U.S. marshals found him there, hiding in a closet. Hamilton also faced charges for stealing the car and fighting with police — he pleaded guilty to theft and resisting arrest Tuesday, and was sentenced to four years on probation.