A Florida man who googled "how to rob a bank" was arrested after authorities say he did just that.

William Joe Johnson, 26, was arrested Monday in the Oct. 5 robbery of an Achieva Credit Union in Largo, near Tampa, Pinellas County Sheriff's Office officials said.

Authorities say Johnson approached a bank teller, implied he had a gun and demanded cash. The teller gave him money and he fled the bank, officials said.

Detectives were able to identify Johnson as the suspect and found him at an Express Inn, where he was taken into custody, officials said.

Johnson told detectives he needed money so he googled "how to rob a bank," authorities said. He said he planned to rob a different bank but changed his mind when he discovered the teller was a large man, authorities said.

Johnson said he used the money he stole to pay his rent, utilities and go on a drug binge, authorities said. The money ran out and he had planned to rob another bank but was arrested before he could, authorities said.

Authorities charged Johnson with one count of robbery. Attorney information wasn't available.