Police arrested a former McDonald’s employee Wednesday after he put on a clown mask, grabbed a gun and robbed his previous place of work, authorities in Bloomington, Indiana, said.

>> Read more trending stories

Police said Juan Ramon Rivera, 20, confessed to detectives before he was charged with robbery and criminal confinement.

Rivera was accused of robbing a McDonald’s in Bloomington at gunpoint.

Authorities were called the fast-food restaurant around 3 a.m. Wednesday for a report of an armed robbery in progress. Witnesses told police that the robber was dressed in all black clothing with white shoes and a clown mask when he came into McDonald’s, brandishing a gun.

Armed with what appeared to be a semi-automatic handgun, which police later learned was a pellet gun, the robber forced the restaurant’s manager into a back office and stole $900.

He ran from the restaurant before police arrived.

Witnesses told police that the robber appeared familiar and pointed officers to Rivera, a former employee.

“The witnesses told the detective that the former employee had shown the same mask to the last year and, in fact, showed investigators a photo of him wearing it,” police said in a news release. “They also stated (that) they recognized his voice.”

Investigators got a search warrant for Rivera’s apartment, where they found the clothes worn during the robbery, the clown mask, the gun and about half of the stolen money, police said. Rivera told detectives that he had robbed the McDonald’s so that he could pay rent.

He remained jailed Thursday in Monroe County.