BRIDGEPORT — It was like some cheesy crime flick.

A hired gun gets the wrong motel room number and bam! — an innocent man gets it.

In this case, 12 was 48-year-old Alfanso Anderson’s unlucky number.

Police said Anderson was shot multiple times in Room 12 at the Sunny Side Inn on Feb. 26, 2018. Only, Anderson wasn’t supposed to be in that room, police said. In that room, they said, there was supposed to be a guy named “Leo” who had stiffed a prostitute out of $800.

The alleged hired gun, Glenn “Capo” Pettway, 25, on parole for a prior robbery, was ordered held in lieu of $1 million bond during his arraignment in Superior Court on Tuesday.

On the night of the shooting, police found Anderson lying on his back between the bed and the bathroom. He was pronounced dead from multiple gunshot wounds.

Detectives checked the motel’s video surveillance of that night and found it had been a busy place.

Shortly after 10, a car dropped off a young woman who proceeded to Room 12 but then, pausing, turned around and left, police said the video showed. A short time later, police said, Anderson is seen on video checking it at the motel’s front desk, then toward Room 12.

A half-hour later, the woman is back, police said. This time she and another man approach Room 12, look in the window and then leave. Minutes tick by on the video, and then the woman is back with two men.

After appearing to go to into the room, police said, the video shows the woman and two men running out. One man, later identified as Pettway, has a silver gun in his right hand, police said. They leave in two vehicles.

Police said they later identified and interviewed the woman in the video, and that she said she was a prostitute who previously had sex with a client she only knew as Leo. She met him through a dating website and, after having sex with her, Leo was supposed to send her $800 through a payment app, police said the woman told them.

But the money never came through.

Police said the woman’s pimp, upset at not getting his money, demanded that she contact Leo and set up a meeting.

She did what she was told.

Police said the woman, after contacting Leo, told her pimp he would be in Room 12 at the Sunny Side.

Later that night they went to the motel, the woman, her pimp and Pettway, police said.

When they burst into Room 12, there was a man the woman didn’t recognize sitting on the bed, police said.

“What is this about?” the woman recalled the man asking.

Police said the woman then heard multiple gunshots.

As they left Anderson bleeding on the room floor, police said the pimp remarked: “This is the sloppiest (expletive) I’ve ever seen.”