A year and three weeks ago in the Saint Paul suburb of Falcon Heights, Minnesota, a 32-year-old man by the name of Philando Castile was shot and killed by a police officer after his car was pulled over. The footage of the shooting’s immediate aftermath, live-streamed on Facebook by Castile’s horrified girlfriend who had been travelling with him, ensured media coverage, but by this point the scenario was tragically familiar. Castile was one of 258 black men killed by police officers in the US in 2016.

That same 6 July, near Kannapolis, North Carolina, the cast and crew of a new TV show, Shots Fired, were preparing to film the pivotal scene in their 10-part drama about race and justice. This was the scene in which black police officer, Deputy Joshua Beck, shoots dead a white teenager at a traffic stop. “If you remember, I think the day before Philando was shot, there was another shooting [of Alton Sterling in Baton Rouge],” recalls Tristan Mack Wilds, who plays Beck. “So you know, I’m coming on the set and I’m breathing heavily and watching [Castile’s] girlfriend on Facebook, like, as it’s going on, and its just hitting me like: ‘Yo, this is ridiculous. When is this going to end?’ I remember walking into my trailer and the first thing I see is my character’s police uniform and everything hit me like a tidal wave. Just hit me. I was overcome with just … emotion.”

Watch the teaser for Shots Fired.

That feeling, of loyalties colliding and prejudices challenged, will be familiar, to some extent, to any viewer of Shots Fired, now mid-season on Fox. Even given the charged nature of its subject matter, this is an exceptionally intense television show. Created and exec-produced by husband-and-wife team Gina Prince-Bythewood and Reggie Rock Bythewood, it tells the story of Gate Station, a small US city – a city like Ferguson or Charlotte, or Saint Paul – where centuries -long community tensions are brought to a head by the police-involved killings of two teenage boys, one black and one white. Sanaa Lathan and Stephan James star as an ex-cop-turned-expert investigator and a lawyer teamed by the Department of Justice to investigate. They are, by turns, aided and frustrated by the local political establishment, played by an impressive ensemble cast including Helen Hunt as the state governor and Richard Dreyfuss as a local real estate mogul.

Since August 2014, when protests in Ferguson, Missouri made Black Lives Matter international news, television has tried to depict the movement, with varying degrees of sensitivity and success. The last series of Scandal improved on reality with – spoilers ahead – a frankly fantastical ending in which the racist officer was prosecuted and anti-corruption legislation was introduced. The Good Wife wasn’t so much criticised as pitied for a cringingly tone-deaf episode in which two wealthy white characters debated racial injustice in a hotel kitchen, surrounded by mostly black staff who later broke into applause. Law & Order characteristically used it as another “ripped from the headlines” plot. Shots Fired is palpably something different.

“It was extremely emotional for all of us,” recalls Wilds who, prior to being cast as Adele’s love interest in her Hello video, was best known in the UK as Michael the soft-spoken corner boy from The Wire. “On other sets, you can go home, decompress, watch cartoons or whatever, to just take your mind off it. The greatest and the worst part with this was you turn on your television, you open your phone up and you see another kid shot. You see another police officer getting off; you see another incident and another incident and another incident, damn near every day.”

Line of duty ... Sanaa Lathan as Ashe Akino in Shots Fired. Photograph: Motion Picture/Fox

Lathan who plays investigator Ashe Akino, describes a similar on-set experience: “After Philando got killed, we came in the next day and our first AD [assistant director] was in tears. We did kind of a prayer circle because it was just too close to home.” She says it was coming to understand acting as a kind of activism that kept the cast going. “We want to entertain people, and it is very entertaining, but we also want to inspire people to address the issue.”

Yet cop dramas and police procedurals are not traditionally the locus of fiery, thought-provoking challenges to the status quo. In fact, several studies suggest that genre viewers are more likely to have positive attitudes towards the police, as well as supporting punitive policies such as capital punishment. And since the majority of people have little personal contact with the criminal justice system in their daily lives, these dramas can become a key source of public “information”. Kathleen Donovan, a political science professor at St John Fisher College, New York and researcher in this field, perceives an anti-civil liberties message in most cop shows. “[On TV] the typical criminal is a bad person who very consciously and deliberately decides to commit crime,” she says. “The typical cop is ‘married to the job’ and though he or she may need to break a few rules from time to time, the ends justify the means because they are the ‘good guys’.”

The mechanism for delivering this message is not so blatant as the straightforward racial stereotyping of young black men – a recent study of Law & Order found that the show actually over-represents whites and females as both victims and perpetrators – but this may also be a part of the problem. “In an effort to be unbiased and post-racial, there is a tendency to focus on the crime and the process of solving it, with little consideration of the social factors involved,” says Alex Vitale, author of forthcoming book The End of Policing. “In fact, the history of crime, police, courts and prisons is a history of race relations. By glossing over that history, [police dramas] perpetuate the illusion that racism is not at the centre of American social relations.”

On patrol ... Tristan Mack Wilds as Deputy Joshua Beck in Shots Fired. Photograph: Motion Picture/Fox

So while the real-world racial bias of the criminal justice system is well documented (black Americans are no more likely than white Americans to use or sell drugs, but are arrested at twice the rate, to give one example), the criminal justice system, as seen on television, is devoid of all such context. No doubt the reasons why juries nearly always acquit in cases of police-involved shootings are complex, but it seems likely that the TV-promoted image of the always-benevolent copper might have something to do with it.

What would a radical, change-promoting police procedural look like? Probably a lot like Shots Fired, which not only features a range of prominent non-white characters but crucially also challenges the liberal erasure of race, gender and class by fully exploring how these characters’ backgrounds impact on their experience. So, Lathan’s Ashe Akino is not a law-enforcement agent who just happens to be a black women; she’s a law-enforcement agent whose experience of systemic discrimination has forced her to develop a finesse in dealing with people in positions of power that her male, Ivy League-educated partner lacks.

“I love that whole paradigm shift with the partners,” says Lathan. “You usually see two men, and with this being a woman and a man and the woman being the older one, it’s new. She the veteran and he’s the green one.” In many ways, Akino is the closest Shots Fired gets to that old TV staple, the “maverick cop”. She’s got the troubled home life, the low-level drinking problem and the passion for justice, but she can’t afford to cut corners in quite the same way that white men such as The Wire’s McNulty or The Shield’s Vic Mackey do. It’s a subtle subversion which reminds us of the ways in which privilege works, both in criminal justice and TV representation.

Carolina scheming ... Helen Hunt as Governor Patricia Eamons in Shots Fired. Photograph: Motion Picture/Fox

Many of Shots Fired’s viewers will need no reminding, however, as Wilds points out. “I think there’s enough going on in our communities where no matter how many cop shows we see, it’s not gonna change the way that we feel just walking outside,” he says. He was raised in a “pretty poor neighbourhood” in New York, at the height of the stop-and-frisk era. “So, I’ve definitely had my own run-ins with police officers. It had me grow up with the mindset of not necessarily NWA the police, but very, very close to it, y’know?”

As well as literally stepping into a policeman’s shoes to play Officer Beck, Wilds’s research involved spending time with real officers, observing their work and hearing their points of view. Did it make him feel more sympathetic? “I don’t want to say ‘sympathetic’. I think it’s more of just an understanding thing. I don’t condone anything that these police officers are doing out here; it’s ugly, it’s disgusting, but I come from a place now of understanding their training and understanding a lot of police officers’ mindsets.”

It’s this same kind of understanding-not-sympathy that Shots Fired affords all its viewers. It’s also this exploration of several perspectives – black, white, male, female, rich, poor, police, civilian – that means it could never be simply Black Lives Matter: The Show. “As much as I would want to say that it is, I can’t,” says Wilds. “I am very much pro-Black Lives Matter, but this is a show that’s for all of us, not just one race, not just one person. This is for us all to look at each other and understand that we’re all human in this.”

Shots Fired continues 23 July, 9pm, Fox