Dashcam footage from officer Jeronimo Yanez’s fatal encounter with Philando Castile was played publicly for the first time Monday, showing him fire seven shots about a minute into the traffic stop.

Officer Joseph Kauser, Yanez’s backup, was so startled by the shots he leapt backward.

“Oh my God!” screamed Castile’s girlfriend, Diamond Reynolds, who was almost hit by a bullet that lodged in an armrest between her and Castile.

Yanez let out a barrage of profanity as Reynolds began broadcasting and narrating a Facebook Live video that would go on to draw millions of viewers across the world.

The brief squad video was played to a packed courtroom during the prosecution’s opening statements and about an hour before Reynolds took the witness stand to testify in Yanez’s manslaughter trial.

It showed a limited view of the events, capturing the back of Castile’s car and traffic on Larpenteur Avenue, but little detail of movement inside Castile’s white Oldsmobile.

“I told him not to reach for it!” Yanez yelled, his gun still drawn and pointed at Castile.

“He had, you told him to get his ID sir, and his driver’s license,” Reynolds responded.

Yanez is heard telling Castile that his brake lights aren’t working, and later, calling to report the shooting.

“Despite being hit twice in the heart…,” assistant Ramsey County Attorney Richard Dusterhoft told jurors, “[Castile’s] last words were, ‘I wasn’t reaching for it.’ ”

Castile was struck by five of the seven shots.

Families show restraint

Castile’s mother and several supporters watched with composed silence.

Likewise, Yanez’s parents, brother, wife and several supporters remained silent, all having been warned earlier by Judge William H. Leary III to refrain from showing any “overt” reaction.

Yanez, 29, a St. Anthony police officer, is charged with second-degree manslaughter for shooting Castile, 32, shortly after 9 p.m. on July 6, and two counts of dangerous discharge of a firearm for endangering Reynolds and her daughter, then 4, who were in the car.

Dusterhoft told a jury of six women and nine men that Yanez stopped Castile based on limited information that he thought matched a suspect in a recent armed robbery. (Castile was not involved in the incident.)

“What he could see were dreadlocks, eyeglasses and the fact that Mr. Castile was a black man,” Dusterhoft said. “Based on that glimpse” he stopped the car in Falcon Heights.

Castile was shot after voluntarily telling Yanez he had a gun, Dusterhoft said, adding that Yanez’s instructions — “OK, don’t reach for it, then” — could have been clearer.

“He didn’t tell Mr. Castile to freeze,” the prosecutor said. “He didn’t tell him to put his hands up.”

Defense attorney Paul Engh argued in his opening statements that Castile ignored Yanez’s orders, forcing the officer to act within his training and accepted police protocol to protect himself.

“He has his hand on the gun,” Engh said of Castile’s movements in the car. “The next command is, ‘Don’t pull it out.’ … [Yanez] can’t retreat … But for Mr. Castile’s continuous grip on the handgun, we would not be here.”

Engh tried to humanize Yanez, telling jurors that he grew up in a working class Mexican-American family that once depended on food stamps, and that he had faced prejudice in his life. (Castile, Reynolds and Reynolds’ daughter are black; race featured prominently during several days of jury selection last week.)

Yanez, who has a 2-year-old daughter with his wife and expects a baby boy in October, was hired by St. Anthony in November 2011.

“It was one of the best days of his life,” Engh said.

Yanez had to be “proactive” in firing at Castile, because of how little time police have to react to a deadly threat, the defense argued.

“He was trained … to go home at the end of the night,” Engh said. “To preserve himself. To protect himself.”

“[Castile] looks like the picture of the robber,” Engh told jurors. “[Yanez] doesn’t know for sure … He’s supposed to stop people; this is his job.”

The video struck a visceral nerve with Pastor Danny Givens Jr., a clergy liaison with Black Lives Matter Minneapolis who attended Monday’s proceeding.

“It was appalling to watch,” Givens said. “I’ve never seen anything like it in my life. There are so many other ways … [for Yanez] to prepare for something like this.”

Leary also ruled Monday morning that evidence about Castile’s permit to carry a handgun will be allowed in trial. Attorneys for Yanez objected last week to including the evidence and said if prosecutors wanted it admitted at trial, the defense would raise the theory that Castile lied about his alleged marijuana use on the permit application.

Reynolds takes stand

Reynolds took the witness stand about 4 p.m., telling the court that she and Castile had been dating for three years, and that he was her daughter’s father figure. Her composure faltered as Assistant Ramsey County Attorney Clayton Robinson showed her a photo of Castile with her daughter at the Mall of America’s Nickelodeon Universe on the girl’s birthday.

“She was very close to him,” Reynolds said, dabbing her eyes and nose with a tissue.

Defense attorney Earl Gray objected to the prosecution submitting the photo as evidence.

“There are already two pictures of him” as evidence, Gray said.

Leary overruled the objection.

Reynolds’ testimony ended at 4:30 p.m. before she had the opportunity to recall the shooting. She is expected to resume Tuesday morning.

Race at issue

Race became an issue earlier in the afternoon Monday when attorneys tried to whittle down a jury pool of 23 down to 15 using peremptory strikes.

Defense attorneys tried to strike an 18-year-old Ethiopian-American college student. The prosecution challenged the move, arguing that it was inappropriately based on the woman’s race.

“The court is aware she is one of only two persons of color” in the pool, argued prosecutor Jeffrey Paulsen.

Gray argued that the woman, who immigrated to the United States at age 10, did not have a proper grasp on the criminal justice system. Gray grilled the woman — Juror 17 — last week on legal definitions not asked of other jurors.

“Juror 18 was a white female in her 40s…,” Leary said. “She didn’t display any more sophistication … and yet the defense failed to ask a single question to juror 18” about legal terms and the criminal justice system.

Leary denied the strike. Both persons of color, including a young black man, were seated as jurors.

Twitter: @ChaoStrib