In both attempted robberies, the would-be robber handed a teller a note demanding money. There were no reports of a weapon being shown.
Mr. Procopio said authorities have confirmed Mr. Morales was the person who tried to rob the Somerville bank but have not identified him as the person in the earlier attempted robbery in Cambridge.
Mr. Morales is a former Army reservist who was being held at Wyatt, which has about 800 inmates, on charges he stole 16 firearms from a U.S. Army Reserve Center in Worcester. He also was facing child rape charges.
Earlier Thursday, authorities said they were investigating whether Mr. Morales was the man who tried to rob a bank in Cambridge, his hometown.