“I’m from the generation born during the dictatorship, when all of civil society was united in opposition to the military, so I’ve never experienced anything like this,” said Elena Soarez, who wrote the script of “The Mechanism” with Mr. Padilha. “The country has been riven, with families divided and lifelong friends quarreling, and that makes this a special challenge to write.”

Rather than focus on politicians and business magnates, the series revolves around three fictionalized characters: a well-connected and morally warped money launderer and two tenacious police investigators, an older man and a younger woman. Though the intricacies of the Brazilian legal and political system may not be familiar to foreign viewers, the series’ political thriller format — cast and creators referenced works like “All the President’s Men,” “Scandal” and “Three Days of the Condor” — certainly will be, as will be the idiosyncrasies of the main characters.

“I’ve always enjoyed watching noir detectives, and now I finally get to play one, a guy who is fighting against his external and internal demons,” said Selton Mello, cast as the investigator Marco Ruffo. “Ruffo is an obsessive in a search for justice, an almost solitary figure amid the machinery of corruption, a kind of Quixote with a lot of personal dramas.”

Throughout his international career, which began in 2002 with “Bus 174,” a documentary which used a bus hijacking to examine how Brazil’s criminal justice system treats the poor, Mr. Padilha has focused on the related issues of crime, justice and violence. scrutinizing both those who mete it out and those who are on the receiving end. Regardless of where, what language or in what medium he has worked, whether in a pair of “Elite Squad” movies about SWAT-like teams in Rio, his 2014 remake of “RoboCop,” or in “Narcos,” the police have always been central to the stories he tells.