BANGOR, Maine — After deliberating for 2.5 hours Thursday, a jury found a homeless man who was seen by an off-duty state trooper last spring walking toward the front door of a Corinth credit union wearing a mask and black latex gloves not guilty of attempted robbery.

“I think the process worked,” Jerome G. Richards II’s defense attorney, F. David Walker IV, said after the verdict was read late Thursday afternoon. “I think the state didn’t have evidence to prove Jerry Richards was trying to rob a bank.”

A smile quickly spread across Richards’ face when he heard the not guilty verdict. He patted his attorney on the back, shook his hand, then hugged him.

“Thank you so much,” he could be heard saying.

Richards, 25, was seen June 1 by Maine State Police Trooper Brian Bean, who was in his personal vehicle with his children, wearing a sweatshirt backward with holes cut out for his eyes and walking toward the front door of the Maine Savings Federal Credit Union on Route 15 in the minutes before it was to close.

Bean grabbed his cell phone and called police, an action that Richards saw, the trooper testified.

Richards never went into the credit union and, after walking around the front of the building, removed the mask, the trooper testified during the two-day trial.

Richards was arrested shortly after leaving the area by Penobscot County sheriff’s deputies, who found two pellet guns — one under the passenger seat of the car Richards was riding in — a pair of black latex gloves, a large knife and an extra clip for one of guns, also inside the car, which was driven by a female friend.

He was charged with attempted robbery, failure to sign a summons and failure to give a correct name.

During Walker’s closing arguments Thursday, he said, “We can all agree that Mr. Richards looked suspicious. Trooper Bean did the right thing.”

But “Is looking suspicious proof enough that he was going to rob that bank?” Walker asked the jury.

Penobscot County District Attorney R. Christopher Almy, who prosecuted the case, was philosophical about the verdict.

“I thought we had a really strong case,” he said in the halls of the Penobscot Judicial Center after the verdict was read. “The police did a great job.”

Almy also noted that “we weren’t able to tell the jury about [Richards’] background,” and suggested that the jury might have felt sorry for the defendant, who is jobless and homeless.

Richards was convicted in May 2009 of receiving stolen property involving a firearm, and in April 2005 of carrying a stolen weapon, Almy said.

Witness Andrew Libby testified Thursday that he and his fiancee had allowed Richards to stay at their apartment on and off for about six months, and that Richards sometimes slept in Libby’s car.

During their deliberations, the jurors asked to hear the charges against Richards read back to them. They later asked to see the bank bag — which held one pellet gun, a knife, necktie and an extra clip for the gun — that deputies found in the back seat of the vehicle Richards was riding in.

Before the jury returned to the courtroom Thursday morning, Richards entered two guilty pleas for his failure on June 1 to sign the summons-complaint and for providing a false name.

After the jury was discharged late Thursday afternoon, Superior Court Justice S. Kirk Studstrup sentenced Richards to 60 days for each offense, to be served concurrently, and said he would be credited for the time he served at Penobscot County Jail awaiting trial. Richards has been in jail since his arrest, some 80 days ago, but was not released Thursday because he has been charged in Somerset County with violating his probation.

As Richards and his attorney parted company Thursday afternoon — with Richards heading back to jail and Walker going home for the night — the defense attorney said, “Take care of yourself.”