LEWISTON – The first clue was a rental car that drove through a Maine Turnpike toll in Wells on Monday without paying 50 cents.

New Hampshire police pieced together the puzzle with that information and a composite picture of a bank robber.

Those discoveries set in motion a series of events that eventually led to the arrests of three men Wednesday wanted in connection with bank robberies in the two states and the seizure of about 14 pounds of marijuana.

Lewiston detectives contacted Portsmouth, N.H., police last week after tracing the ownership of a getaway car from the scene of a Sabattus Street bank robbery April 25.

A man escaped with an undisclosed amount of cash in a heist at Bank of America. It marked the second time in three weeks that branch had been robbed. The first robbery there was committed April 5.

Information about the vehicle eventually came back to a rental car in Portsmouth.

At the same time, Lewiston detectives sent a composite picture of the bank robber to Portsmouth police. Two detectives there recognized the man as Michael V. Hehir, 21, of Portsmouth.

“He’s well known to us,” said Portsmouth police Capt. Janet Champlin in the detectives bureau said Friday.

Portsmouth police said Thursday that Hehir admitted to the bank robberies and that he is also a suspect in a local drug investigation involving the distribution of narcotics to high school students.

A second man arrested in the case is Richard C. Hamilton, 33, of Lee, N.H. Hamilton is an associate of Hehir and also is a friend of the person who rented the getaway car.

Police said Hamilton, a glassblower by trade, is wanted in Maine, Florida and Massachusetts. They said he has a criminal record that includes assault with a deadly weapon and robbery with a firearm.

Interviews with Hehir and Hamilton corroborated the scenario police had developed for the case, investigators said. Police believe the men also were responsible for a robbery in Hookset, N.H., on March 17.

“It was great working with the Lewiston detectives,” Champlin said. “They were very helpful in the capture.”

Staff writer Mark LaFlamme contributed to this report.