Mr. Choi said Officer Yanez spotted Mr. Castile, a 32-year-old school cafeteria worker, driving along a stretch of road near the state fairgrounds with his girlfriend and her young daughter. Officer Yanez believed Mr. Castile matched the description of a suspect in a nearby armed robbery from a few days earlier, radioing a colleague that Mr. Castile’s “wide-set nose” seemed to match the surveillance video from that case, and that his car also had a broken taillight.

Image Officer Jeronimo Yanez outside the City Council chambers in St. Anthony, Minn., in 2013. Credit... Christian Dobratz, via Associated Press

But when Officer Yanez pulled Mr. Castile over in the tiny suburb of Falcon Heights, the conversation described by prosecutors started out as ordinary, with no mention of the robbery and no discussion of the smell of marijuana that Officer Yanez would later recount to investigators. (Mr. Choi said Wednesday that Mr. Castile was not a suspect in the armed robbery case.)

Mr. Castile, who had been pulled over dozens of times before, seemed to know the routine: He kept his seatbelt fastened, greeted Officer Yanez and handed over his insurance card, according to prosecutors’ version of events. Then, before his girlfriend said he reached for the wallet that contained his driver’s license and permit to carry a pistol, Mr. Castile said, “Sir, I have to tell you that I do have a firearm on me.”

Within seconds, Officer Yanez, of the St. Anthony police, had shouted, “Don’t pull it out,” and Mr. Castile and his girlfriend, Diamond Reynolds, tried to assure him that he was not grabbing the gun. But Officer Yanez quickly fired seven rounds, fatally wounding Mr. Castile just 62 seconds after the traffic stop began. An instant later, Mr. Castile moaned and said, “I wasn’t reaching for it.”

“His dying words were in protest that he wasn’t reaching for his gun,” Mr. Choi said.

Mr. Castile’s death is among the highest-profile cases of the countless police interactions with black men that have roiled the country, and especially Minnesota, in the last two years. The case drew international attention, largely because Ms. Reynolds streamed the aftermath on Facebook Live, calmly but firmly recounting her version of events and disputing Officer Yanez’s narrative as blood soaked through Mr. Castile’s white T-shirt.