Receive the latest new-england updates in your inbox

A 5-day manhunt for escaped inmate James Walker Morales ended after police say he was involved in two attempted bank robberies in Massachusetts. (Published Friday, Jan. 6, 2017)

An escaped inmate who had been on the run since New Year's Eve was arrested on Thursday afternoon in Somerville, Massachusetts, according to Massachusetts State Police.

James Walker Morales was arrested by a state police trooper after attempting to rob a bank in Somerville, just hours after he tried to rob another bank in neighboring Cambridge, according to officials. He is being booked at state police barracks in Medford.

Police Transport Escaped Inmate After Capture

James Morales was on the run since his escape from a Rhode Island prison on New Year's Eve. He was captured Thursday after a pair of attempted bank robberies in Massachusetts.

(Published Thursday, Jan. 5, 2017)

"We're just grateful for the heroic efforts of law enforcement to capture a very dangerous person," Somerville Mayor Joseph Curtatone said. "He's pretty capable of anything, and was acting very brazenly. We're just grateful nobody was hurt."

The first attempted robbery took place at the Bank of America at 727 Massachusetts Ave. around 9:30 a.m. Morales passed a note to the teller but did not get away with any money and fled in the direction of Harvard Square. The second attempted bank robbery occurred at Citizens Bank in Somerville.

A trooper spotted Morales in the area of Route 28 and Mystic Avenue. The suspect ran and the trooper pursued him on foot for about two blocks before apprehending him as Morales was attempting to jump a fence in the Foss Park neighborhood. A neighbor said within minutes, more than a dozen police cruisers were on scene.

Morales, 35, escaped from the high-security Wyatt Detention Center in Central Falls, Rhode Island on the evening of Dec. 31. He broke out during recreation by climbing onto a roof and scaling barbed wire fences, the warden said.

Excellent teamwork by public safety officials to bring this fugitive into custody, including MSP Trooper Merrick who apprehended Morales. https://t.co/A6I9EK6hRI

Morales, a former Army reservist, is accused of stealing six assault rifles and 10 handguns from the Lincoln Stoddard Army Reserve Center in Worcester in 2015. He was arrested in New York days after the theft, and most of the guns were recovered.

Several area communities were on heightened alert after the inital bank robbery on Thursday.

Escaped RI Prisoner Caught Trying to Rob Another Bank

James Morales, who escaped from a RI facility, was captured in Somerville, Mass. after police say he tried to rob a second bank.

(Published Thursday, Jan. 5, 2017)

Cambridge sent an email to city leaders just before noon informing them of the search and noting that Morales is a former Cambridge resident. Somervillle placed its schools on hold, cancelling outdoor activities, and sent out a reverse 911 warning to residents. Arlington police issued an alert on its social media channels telling residents that helicopters were in the area searching for the bank robbery suspect. But schools were not put in lockdown.

At the request of police, MBTA service on the Red Line was temporarily held up as police investigated Thursday morning's bank robbery, causing minor delays between Alewife and Central stations.