Police, criminal justice and guns were focal points of 2016 political ads long before last week’s tragic events, which left two African American men dead after being shot by police, as well as five policemen killed by a sniper at a protest in Dallas.

The recent deaths have raised all of these issues, as gun ownership has been woven into the issues surrounding policing — Philando Castile was a legal gun owner, and Castile’s girlfriend says he was reaching for his gun permit to show a policeman when he was shot. After the sniper, Micah Xavier Johnson, killed five policemen and injured seven, policemen on the scene had trouble sorting out who was doing the shooting at the Dallas demonstration, since several people there were carrying guns openly as the state law allows.

During the primaries, Hillary Clinton’s campaign ran several ads focusing on these subjects. In this ad, which aired widely in South Carolina leading up to the primaries there, as well as in North Carolina, Clinton is shown speaking while footage of African American families appears on the screen.

“Something is just fundamentally broken when African-Americans are more likely to be arrested by police and sentenced to longer prison terms for doing the same thing that whites do,” says Clinton in the ad. “When too many encounters with law enforcement end tragically, we need investments in education, health care, and jobs to counter generations of neglect. We have to face up to the hard truth of injustice and systemic racism,” she says. At the time, PolitiFact gave the claims in this ad the rating of “True.”

Clinton also published an ad featuring the mothers of African Americans who have died at the hands of police recently or while in custody, including Sandra Bland and Trayvon Martin.  Another ad by Clinton’s campaign features Erica Segielski, daughter of Sandy Hook Elementary School’s principal, Dawn Hochsprung, who was killed in the December 2012 mass shooting there. The ad reportedly ran in Connecticut in April, leading up to the primary there.

Meanwhile, Donald Trump connected gun violence to immigration, with this ad that tells the story of an African American man who was shot and killed by an “illegal immgrant gang member who just got out of prison.” The ad notes that this young man’s father is “supporting Donald Trump for President because he knows he will end illegal immigration.” The father is shown saying, “Trump is the only one saying you’re gonna be dealt with, we’re gonna enforce that. We’re gonna enforce that. That’s a beautiful thing. I believe Donald Trump wants to make us great again and he loves America.” This ad aired more than 1,400 times in North and South Carolina, Florida, and Ohio.

Trump’s campaign also published this video after last week’s events, in which Trump talks directly to the camera, talking first about the slain policemen and then about the deaths of Philando Castile and Alton Sterling. Trump has not been airing paid ads in the general elections.

These issues have also been featured in Senate campaigns. For example, this ad by incumbent Pennsylvania Sen. Pat Toomey, a Republican, aired in Philadelphia leading up to the primaries there. It shows a woman, Trish McFarland, identifying herself as the wife of a police officer and speaking in his favor. A narrator then says, “When rioters destroyed American cities, Pat Toomey stood strong with police. Toomey fought for better police equipment and benefits. And denounced the riots when others wouldn’t.” Toomey is now facing Democrat Katie McGinty in a hotly contested Senate race in November.

;

While most ads featuring these themes have been produced by candidates’ campaigns, some outside groups have also gotten into the fray. For example, this ad, by Americans for Responsible Solutions, a group advocating for tougher gun laws, attacks Kelly Ayotte, the Republican Senate candidate in New Hampshire.

The National Rifle Association, meanwhile, recently produced this ad opposing Democrat Ted Strickland, who is running for the Senate in the key battleground state of Ohio. “The theme of the ad — that Strickland is out for power and money because he once embraced gun rights and has now backed away from those positions — is a stretch to say the least,” reported USA Today in a fact check of this ad. “Plenty of lawmakers change their views on major issues, and there’s no evidence that Strickland’s shift was a money or power grab.”

The NRA has also produced this ad opposing Clinton — but the focus is Benghazi.

To see all the political ads archived by the Political TV Ad Archive project that mention criminal justice issues, click here.

To see ads featuring the subject of guns, click here.

To see ads featuring the subject of police, click here.

Note: air counts at links refer to political ad airings in markets in key primary states tracked by the Political TV Ad Archive. Ads may have aired more widely in states the project did not track. The project is currently tracking ad airings in Philadelphia, San Francisco, and Washington, DC. In August, the project will begin capturing political ad airings in battleground states such as Colorado, Florida, and Ohio. For more details on which states were tracked during the primaries, click here