(BOSTON) -- A Massachusetts state trooper spotted a federal prison escapee in a town outside Boston and chased him on foot for two blocks before taking the man into custody as he tried to jump a fence.
James Morales, 35, had been on the run for days after breaking out of a federal prison in Rhode Island on New Year's Eve.
On Thursday afternoon, after Morales allegedly tried to rob two banks in the Boston area, state trooper Joseph Merrick chased and captured him in Somerville, Massachusetts.
"At the beginning of the shift, we were notified that the subject could be in the area," Merrick later told reporters, according to ABC affiliate WCVB-TV in Boston.
"I saw the suspect which I believed to be the escapee from Rhode Island. After a foot chase, a couple of fences, I was able to get him into custody," Merrick said.
State Police Colonel Richard McKeon said Merrick managed to pull Morales off a fence and tackle him.
Three other officers helped Merrick make the arrest, WCVB reported.
"It was a great job by everybody just to get him off the street, a dangerous man," Merrick said, according to WCVB. "I’m glad I was able to help out."
Morales -- a former Army reservist -- was in federal custody for the "theft of numerous firearms from the Worcester Army Reserve Armory in 2015," Massachusetts State Police said. He was also wanted "for an alleged violent and brutal sexual assault of a child," police said.
He escaped from a Rhode Island federal prison -- the Donald W. Wyatt Detention Facility in Central Falls -- on New Year's Eve, authorities said.
Morales is expected to appear in federal court in Rhode Island Friday morning.
Officials said Morales broke out of the prison by climbing a basketball hoop to reach a rooftop, cutting through a fence and then climbing through razor wire.
Morales was discovered to be missing by prison staff at 10 p.m. on Dec. 31 -- about three hours after he escaped, authorities said.
Jamie Hainsworth, a U.S. marshal for the district of Rhode Island, said earlier this week that officials will take a "hard look" at the procedures of the Wyatt prison and investigate whether the community of Central Falls was appropriately notified of the escape.
Hours before his capture, Morales allegedly tried to rob a bank in Somerville and another bank in nearby Cambridge, Massachusetts.
The FBI in Boston released surveillance images of the Cambridge robbery and urged the public to help police find Morales.
Morales will not be taken back to the Wyatt facility, U.S. Marshal Kevin Neal told reporters.
Copyright © 2017, ABC Radio. All rights reserved.