ST. PAUL, Minn. (AP) — A Minnesota police officer has been charged with second-degree manslaughter after prosecutors determined he acted unreasonably when he shot and killed Philando Castile, a black man whose girlfriend streamed the gruesome aftermath of the fatal shooting live on Facebook, prosecutors announced Wednesday.

St. Anthony police officer Jeronimo Yanez shot the 32-year-old Castile during a July 6 traffic stop in the St. Paul suburb of Falcon Heights. Castile's girlfriend, Diamond Reynolds, was in the car along with her young daughter at the time. The woman said Castile was shot several times while reaching for his ID after telling Yanez he had a gun permit and was armed.

Ramsey County Attorney John Choi, whose office will prosecute the case, said Yanez shot Castile seven times "in rapid succession" and that the evidence shows Castile was calm and complied with the officer's requests after he was pulled over.

Prosecutors believe Castile never tried to pull his handgun from his pocket, Choi said, adding that as Castile was dying, he moaned and uttered his final words: "I wasn't reaching for it."

The fatal shootings of black men and boys by police officers have come under heightened scrutiny since the 2014 death of Michael Brown in Ferguson, Missouri. No charges were filed against the officer in that case, but Brown's death led to calls nationwide for officers to be held criminally responsible.

Choi said in Castile's case that the officer's unreasonable fear did not justify his use of deadly force.

"No reasonable officer, knowing, seeing and hearing what officer Yanez did at the time, would've used deadly force under these circumstances," Choi said. If convicted of second-degree manslaughter, Yanez could face a maximum prison sentence of 10 years.

Yanez's attorney, Tom Kelly, has said Yanez, who is Latino, was reacting to the presence of a gun, and that one reason Yanez pulled Castile over was because he thought he looked like a possible match for an armed robbery suspect. Choi said Wednesday that Castile was not a suspect in that robbery; Castile's family members have said they believe the elementary school cafeteria worker was racially profiled.

Kelly did not immediately return phone messages seeking comment Wednesday. An attorney for the Castile family was planning a news conference Wednesday afternoon.

Castile's shooting prompted numerous protests, including a weekslong demonstration outside the governor's mansion and one protest that shut down Interstate 94 in St. Paul for hours. The interstate protest resulted in about 50 arrests and injuries to more than 20 officers who were hit with cement chunks, bottles, rocks and other objects.

Choi resisted pressure immediately after the shooting to turn the case over to a special prosecutor, but he added one to his team to get an outside perspective. He said Wednesday that he reviewed the case himself instead of sending it to a grand jury in the interest of transparency.

Choi gave a detailed account Wednesday of the events surrounding Castile's shooting, noting that Castile was wearing his seat belt and complied with Yanez after he was pulled over. Choi said Castile volunteered that he had a firearm, which is not required by law.

Choi said Yanez had his hand on his holster before Castile could finish his sentence, and repeatedly shouted "Don't pull it out" before he fired. Choi said the final shot was fired one minute and two seconds after Castile's vehicle came to a stop.

Choi said Castile's gun was later found deep in a front pocket of his shorts, with a loaded magazine but no bullet in the chamber.

He noted that another officer who responded did not touch his weapon and said Castile had made no sudden movements.

Squad car video captured the entire incident, including audio and subsequent conversations Yanez had with other officers, Choi said. He was not releasing the video because it was evidence in Yanez's prosecution.

The announcement comes one day after the anniversary of the high-profile killing by police of another black man in Minnesota, Jamar Clark in Minneapolis. The officers in that case were not charged.