A St. Anthony police officer pulled over Philando Castile because he was driving with a broken tail or brake light and he believed that Castile looked like a suspect from an armed robbery nearby that was reported a few days earlier, the officer’s attorney told the Star Tribune on Sunday.

“All he had to have was reasonable suspicion to pull him over,” attorney Thomas Kelly said of his client, Jeronimo Yanez.

Kelly said his client shot Castile the night of July 6 in Falcon Heights “after he reacted to the actions of Mr. Castile.”

“This has nothing to do with race, and everything to do with the presence of a gun,” Kelly said. “Deadly force would not have been used if not for the presence of a gun.”

Castile’s cousin, Nasiy Mitsvah, accused Kelly of trying to cover up for his client.

“Even if they say he looked like someone in a robbery, it still doesn’t give him a right to kill someone,” he said. “They’re just trying to make a person look really bad.”

Albert Goins, an attorney who assisted the family in the hours following the shooting, said that if Castile was indeed a robbery suspect, officers would have initiated a felony traffic stop.

“A felony stop does not usually involve officers walking up to your car and asking you to produce your driver’s license,” Goins said. “A felony stop involves bringing the suspect out at gunpoint while officers are in a position of cover and having them lie on the ground until they can identify who that individual is.”

Either way, Goins said, Yanez would have failed to follow protocol.

“Either [Castile] was a robbery suspect and [Yanez] didn’t follow the procedures for a felony stop, or [Castile] was not a robbery suspect and [Yanez] shot a man because he stood at his window getting his information,” Goins said.

Kelly declined to say whether Castile told the officer that he had a permit, which his girlfriend said he tried to tell Yanez and the officer with him that night, Joe Kauser, before he was shot.

“[Castile] told him he was licensed to carry and that he had his gun on him and then he started shooting. He started shooting for no reason,” Diamond Reynolds said in a Facebook video as a bloodied Castile lay in the driver’s seat dying.

A source has confirmed that Castile had a valid permit to carry a gun when he was shot and killed.

Kelly said he did not know which robbery prompted Yanez to stop Castile’s car. A day earlier, however, the Minnesota Bureau of Criminal Apprehension sent out a news release asking for the public’s help in identifying two suspects in a July 2 robbery of a Lauderdale convenience store. The St. Anthony Police Department also patrols Lauderdale under a contract with that city.

Both suspects in the July 2 robbery were described as black men with shoulder-length or longer dreadlocks. The descriptions of the suspects included the items of clothing they each were wearing, but did not include estimated height, weight or ages.

Castile wore his hair in dreadlocks, his cousin said.

Castile had been pulled over at least 52 times since 2002 and given 86 citations for minor offenses such as speeding, not wearing a seat belt, or having expired license tabs, according to the Associated Press. About half of those violations were dismissed.

Yanez and his partner, Joseph Kauser, are on paid administrative leave. Yanez has been with the St. Anthony police department since 2011, Kauser since 2013.

A spokesman for the BCA declined to comment on Kelly’s remarks due to the ongoing investigation. When asked if Castile is considered a suspect in the robbery of the Lauderdale convenience store, a BCA spokeswoman referred the question to St. Anthony police, who could not be reached for comment.