SAN FRANCISCO -- A Mexican man accused of killing a woman on a San Francisco pier in a case that set off a national debate over immigration policy brought the gun and deliberately shot it at people, "playing his own secret version of Russian roulette," a prosecutor said in her closing argument Monday.

Jose Ines Garcia Zarate was playing his own game, San Francisco Deputy District Attorney Diana Garcia told jurors, deriding as implausible the defense argument that he accidentally shot a weapon he didn't know was a firearm. Defense attorneys were scheduled to present closing arguments later.

Garcia Zarate had been deported five times and was wanted for a sixth deportation when Kate Steinle was fatally shot in the back while walking with her father on the pier in July 2015. Garcia Zarate did not deny shooting Steinle but said it was an accident.

Get Breaking News Delivered to Your Inbox

The shooting happened during the presidential campaign and touched off a fierce debate over the country's immigration policies. San Francisco's "sanctuary city" law bars local officials from cooperating with federal attempts to deport those in the country illegally, and the city had released Garcia Zarate from custody despite a federal detention request.

The prosecutor on Monday referred to Steinle as a "vibrant life" taken too soon but otherwise did not dwell on the victim in a closing argument that lasted about an hour.

Instead, she painted a picture of a man who hid a firearm in his baggy clothes, went to a pier filled with tourists and whirled about on a stool for more than 20 minutes before shooting it at Steinle's back.

"He knew exactly what he was doing," Garcia said.

Garcia Zarate said he found the stolen gun wrapped in a shirt under a chair on a pedestrian pier and that the weapon accidentally fired when he picked it up. The bullet ricocheted on the pier's concrete walkway before it struck Steinle.

His attorneys say the ricochet showed the shooting was an accident. Much of the testimony during the monthlong trial has focused on ballistics experts.

A judge ruled last week that the jury of six men and six women can consider a more serious charge of first-degree murder in addition to a second-degree murder charge. Jurors are expected to get the case after closing arguments.

Before the shooting, Garcia Zarate had finished a federal prison sentence for illegal re-entry into the United States and was transferred in March 2015 to San Francisco's jail to face a 20-year-old charge for selling marijuana. The sheriff's department released him a few days later after the district attorney dropped the marijuana charge, despite a U.S. request to detain him for deportation.

President Trump said during the campaign that Steinle's death was another reason the United States needed to build a wall on its southern border and tighten its immigration policies. Since taking office, Trump has threatened to withhold federal funding from places with similar sanctuary city laws.

Defense attorneys have told jurors that Garcia Zarate lived on the streets of San Francisco after being released from jail, scraping together a living by collecting recyclables and scavenging for food.