Police investigators testified Tuesday that tourists captured photographs of a murder suspect moments before and after he is alleged to have randomly shot to death a young woman on a waterfront pier.

Neither photo shown in court clearly showed the face of Juan Francisco Lopez-Sanchez, a Mexican national who was in the country illegally.

The suspect appears to share the same slight build as Lopez-Sanchez, who is charged with murder in the shooting death of Kathryn Steinle on July 1.

The shooting re-ignited debate over federal immigration policies of jail inmates. Lopez-Sanchez had been deported five times and was wanted by federal officials for a sixth deportation.

Lopez-Sanchez was brought into court Tuesday heavily shackled at the waist and ankles. The slight man nervously twitched his right leg up and down and stared at the floor during most of the hearing Tuesday morning.

Testimony about the photos and other evidence is expected to continue through Wednesday. The preliminary hearing is being held to determine if there's enough evidence to schedule a murder trial.

Prosecutors showed a "selfie" photo taken of Steinle, her father and a family friend moments before the 32-year-old was killed on Pier 14 along San Francisco's picturesque waterfront.

"They were just doing tourist stuff," San Francisco homicide detective Nico Discenza testified.

Immediately after Steinle was shot, a tourist staying in a hotel across the street from the pier took two photos of a man hurriedly walking away from the scene. Investigators and prosecutors say the man in the photo is Lopez-Sanchez.

A woman from China snapped a photo of the group shortly before the shooting, capturing the same suspect sitting on a chair on the pier as Steinle walks past him.

Before the shooting, Lopez-Sanchez had been transferred to San Francisco jail to face a two-decade old arrest warrant for marijuana possession after finishing a federal prison sentence for illegal re-entry into the United States.

After local prosecutors dropped the marijuana charge, Lopez-Sanchez was released in April despite a federal detention request.

San Francisco and other cities and counties ignore requests from federal authorities to detain jail inmates who are thought to be in the country illegally.

San Francisco Sheriff Ross Mirkarimi said he was following city law when jailers released Lopez-Sanchez after a 20-year-old marijuana possession charge was dropped. But leading politicians, including top Democrats such as California Sen. Dianne Feinstein and presidential hopeful Hillary Clinton, said Lopez-Sanchez should have been detained.

San Francisco Mayor Ed Lee also criticized the sheriff, saying Mirkarimi should have notified immigration officials of Lopez-Sanchez's impending release.

Lopez-Sanchez has pleaded not guilty to murder charges. His public defender, Matt Gonzalez, says the shooting appears to have been accidental.

Lopez-Sanchez told a local television station in jailhouse interview that he found the gun wrapped in a T-shirt on the pier. He said it went off accidentally when he picked it up.