Kelly Macdonald will be the lead guest star in the next season of Jed Mercurio’s “Line of Duty.”

The previous season of the serialized cop drama was a ratings smash on the BBC, with the finale in May the most-watched program of the year so far in the U.K., garnering 13.7 million viewers. AMC Networks’ streamer, Acorn, has the U.S. rights.

Macdonald’s film credits include “Trainspotting,” “No Country for Old Men,” and this year’s TIFF title “Dirt Music.” On TV she recently appeared in the BBC and Netflix co-production “Giri/Haji,” from “Chernobyl” producer Sister.

In the upcoming sixth season of “Line of Duty” she will star alongside series regulars Martin Compston, Vicky McClure and Adrian Dunbar, all of whom are confirmed to return. ITV-owned World Productions makes the show, which is distributed by Kew Media.

Macdonald will play a senior cop called Joanne Davidson. Her unconventional conduct raises suspicions at the AC-12 anti-corruption unit that is the focus of the show.

“We’re honored that Kelly Macdonald will join Martin, Vicky and Adrian in Series 6 of ‘Line of Duty,’” said Mercurio, who was also behind BBC ratings sensation “Bodyguard.” He added: “DCI Joanne Davidson will prove the most enigmatic adversary AC-12 have ever faced.”

Piers Wenger, controller of BBC Drama, hailed Macdonald as “one of the U.K.’s most versatile actors” and said “we’re excited for viewers to see what Jed’s scripts have in store for her when she joins the ‘Line of Duty’ team.”