This 2014 photo provided by Dewanda Harris shows Philando Castile of St. Paul, Minn., posing for a photo while attending a family funeral in St. Paul. Officials say Castile was fatally shot by police in Falcon Heights, Minn., Wednesday, July 6, 2016, while inside a car with a woman and a child. (Dewanda Harris via AP)
This 2014 photo provided by Dewanda Harris shows Philando Castile of St. Paul, Minn., posing for a photo while attending a family funeral in St. Paul. Officials say Castile was fatally shot by police in Falcon Heights, Minn., Wednesday, July 6, 2016, while inside a car with a woman and a child. (Dewanda Harris via AP)

MINNEAPOLIS (AP) _ When Philando Castile saw the flashing lights in his rearview mirror the night he got shot, it wasn’t unusual. He had been pulled over at least 52 times in recent years in and around the Twin Cities and given citations for minor offenses including speeding, driving without a muffler and not wearing a seat belt.

He was assessed at least $6,588 in fines and fees, although more than half of the total 86 violations were dismissed, court records show.

Was Castile an especially bad driver or just unlucky? Or was he targeted by officers who single out black motorists like him for such stops, as several of his family members have alleged?

The answer may never be known, but Castile’s stop for a broken tail light Wednesday ended with him fatally shot by a suburban St. Paul police officer, and Castile’s girlfriend livestreaming the chilling aftermath.

The shooting has added a new impetus to a national debate on racial profiling; a day after Castile died, a black Army veteran killed five officers in Dallas at a demonstration over Castile’s killing and another fatal police shooting, in Louisiana.

The Castile video “is pretty horrific,” said Gavin Kearney, who in 2003 co-authored a report to the Minnesota Legislature on racial profiling in the state. “There are things we don’t know about it. But we know there are certain assumptions and biases _ whether explicit or implicit _ about black men that affect how police officers interpret their actions. And we know white drivers are less likely to be pulled over.”

Court records dating to 2002 show Castile, a 32-year-old school cafeteria supervisor, averaged more than three traffic stops per year and received citations for misdemeanors or petty misdemeanors.

Many charges were dismissed, but Castile pleaded guilty to some, mostly for driving after his license was revoked and driving with no proof of insurance. However, those two charges also were the most frequently dismissed, along with failing to wear a seat belt.

The records show no convictions for more serious crimes.

No recent information is available on the racial breakdown of drivers stopped or ticketed by police in Falcon Heights, the mostly white suburb where the shooting occurred, or in other Minnesota towns. Minnesota is not among the handful of states that require police to keep such data.

But in 2001, the Legislature asked for a racial profiling study and it fell to Kearney, then at the Institute on Race & Poverty at the University of Minnesota Law School, to conduct it. His study, using information supplied voluntarily by 65 law enforcement jurisdictions in the state, found a strong likelihood that racial and ethnic bias played a role in traffic stop policies and practices. Overall, officers stopped minority drivers at greater rates than whites and searched them at greater rates, but found contraband in those searches at lower rates than whites.

The analysis found the pattern was more pronounced in suburban areas. In Fridley, New Hope, Plymouth, Sauk Rapids and Savage combined, blacks were stopped about 310 percent more often than expected.

The St. Anthony Police Department, which employs the officer who shot Castile, did not participate in the study. St. Anthony officials have not commented on Castile’s stop since shortly after the shooting.

It was not immediately clear how much money governments in the Minneapolis-St. Paul area generate from traffic violations. A U.S. Department of Justice investigation following the 2014 police shooting death of Michael Brown, a black, unarmed 18-year-old, in Ferguson, Missouri, found law enforcement efforts were focused on generating revenue for that city. Most of the tickets and fines were going to blacks.

Castile’s girlfriend, Diamond Reynolds, a passenger in the car, said the two officers who stopped them said the vehicle had a broken tail light. She said one of the officers shot him “for no apparent reason” after he reached for his ID.

Valerie Castile said she thinks her son “was just black in the wrong place.” Minnesota Gov. Mark Dayton said he did not believe it would have happened to a white motorist.

The officer who shot Castile, Jeronimo Yanez, is Latino. His lawyer, Thomas Kelly, said Saturday that his client reacted to the fact that Castile had a gun, not his race, though Kelly would not discuss what led Yanez to initiate the traffic stop.

Protesters gather outside the governor's residence Thursday, July 7, 2016, in St. Paul, Minn. A police officer fatally shot Philando Castile as a woman in the vehicle apparently livestreamed the aftermath in a widely shared Facebook video. The shooting happened late Wednesday during a traffic stop in the St. Paul suburb of Falcon Heights. (AP Photo/Jim Mone)
Protesters gather outside the governor’s residence Thursday, July 7, 2016, in St. Paul, Minn. A police officer fatally shot Philando Castile as a woman in the vehicle apparently livestreamed the aftermath in a widely shared Facebook video. The shooting happened late Wednesday during a traffic stop in the St. Paul suburb of Falcon Heights. (AP Photo/Jim Mone)

“Police understand the concerns about choices made about who gets stopped and what happens when they get stopped,” said Darrel Stephens, executive director of the Major Cities Chiefs Association.

But the statistics can’t simply be attributed to racial bias among police.

“When people call the police, they provide a description of somebody engaged in a crime. The police respond to those descriptions,” said Stephens, a former Charlotte, North Carolina, police chief. “That counts for part of the disproportionality that we see in those numbers.”

Last year, the President’s Task Force on 21st Century Policing recommended police departments collect and analyze demographic data on all stops, searches and seizures.

Nationally, 13 percent of black drivers were pulled over at least once in 2011, compared with 10 percent of the white drivers, according to a survey by the U.S. Justice Department’s Bureau of Justice Statistics.

The survey shows 68 percent of black drivers considered the stops legitimate compared with 84 percent of white drivers.

The precise reasons why certain motorists are pulled over more than others are difficult to identify, said Lorie Fridell, an associate professor of criminology at the University of South Florida, who trains police departments through a program called Fair and Impartial Policing.

“Our implicit biases are most likely to impact us when we’re facing ambiguous situations,” Fridell said. “A person reaching into a pocket is ambiguous. If I, as a white, middle-aged woman, reach into my pocket most people aren’t going to experience fear. For a black male with dreadlocks, that ambiguous action would produce fear in many people.”