Veteran Hong Kong director Johnnie To seemed to be setting himself up for failure with his new film “Drug War.” The film, a co-production with Mainland Chinese studios, had to satisfy the country’s notoriously strict film censorship laws. The marvel of To’s work with co-producer Wai Ka- Fai is that the resulting film manages to be an enthralling piece of crime cinema.

Under Mainland Chinese law, getting caught manufacturing more than 50 grams of methamphetamine earns you an instant death sentence. Captured meth manufacturer Timmy Choi (veteran Hong Kong actor Louis Koo) has literally churned out tons of the illicit drug. The prisoner strikes a bargain with drug squad Captain Zhang (Mainland star Sun Honglei). If the captain spares his life, Choi will exploit his knowledge of and connections in the local drug trade to help bring down cartel head Bill Li. But as the fortunes of both cops and crooks become fluid, the informant’s trustworthiness will determine which side emerges victorious.

China’s censorship standards could be historically described as “Motion Picture Production Code Plus.” A “no explicit sex” rule would make exporting the sexual surrogate drama “The Sessions” to that country a waste of time. Forbidding the mention of “politically sensitive” subjects is code for such topics as Tiananmen Square and China’s methodical undermining of Tibetan culture. The “no explicit violence” ban would probably keep out the likes of “Hostel.”

To mentions in the press materials another factor that made making “Drug War” a bad idea. Out of the five hundred-plus films produced annually in Mainland China, only two or three are crime thrillers. The director does not explicate the reasons for this situation. But if one thinks of crime thrillers as violent dramas built around a societal fracture point, then a country invested in projecting an image of itself as possessing an ideal society will look dimly on films that pronouncedly undercut that image. The rise in illicit drug use in Mainland China courtesy of capitalism’s explosion would theoretically reflect badly on that country’s reputation.

Given these barriers, it is to To’s creative credit that he did not do a Jackie Chan-style rollover for the Mainland Chinese authorities. Such commercial conventions as having the forces of law ultimately emerge triumphant are honored. Yet the film’s effect is in line with the director’s previous works.

To’s better films have been marked by his willingness to take commercial cinematic genres into unexpected territories with unique storytelling twists. “Exiled” blended its brotherhood among hired guns story with moments of self-aware absurdity. “Sparrow”’s pickpocket caper provided an excuse to create a valentine to both old Hong Kong and 1950s cinema. Even “Life Without Principle” leavened its tragic subject of financial meltdown through having Lau Ching Wan’s holy fool character undercut the popular lie of investment success as a product of skill and intelligence.

“Drug War”’s dramatic concern lies less in whether Captain Zhang and his team will destroy Uncle Bill’s cartel than in whether Choi can escape his predestined fate. From Koo’s first appearance onscreen, To repeatedly emphasizes that Choi is only one step away from death. Whether it’s escaping an explosion or risking getting killed if his cooperation with the police is discovered, the informant comes across as a noir protagonist who slowly finds his escape options drying up.

The director balances this dramatic grimness with small moments of humanity and humor. When Captain Zhang allows a pair of cops shadowing a meth supply truck to take a break, said cops’ first act is to stop for a much delayed bathroom break. Go-between HaHa is so named for his constant laugh. The group of mutes who make Choi’s meth are willing to burn a fortune in illicit profit in mourning for Choi’s wife. “Drug War”’s plot playfully inverts the standard “Mainland Chinese come to Hong Kong to stir up trouble” plot by reversing the participants’ nationalities.

But “Drug War” is more than just a series of clever twists on familiar plot formulas. The scrupulous realism of the milieu depicted in the film is the product of To and Wai’s extensive research. Skeptical viewers can rest assured that the use of deaf mute drug factory workers or a near fatal cocaine inhalation test come not from the scriptwriters’ imaginations but from actual drug squad anecdotes.

Even the stunning shootouts are based in the Mainland Chinese police’s realities in fighting their drug war. Given the certainty of execution upon police capture, anybody caught being involved in the drug trade will prefer to take a chance shooting their way to freedom. If anything, given the setting of “Drug War”’s climactic gun battle, it’s reasonable to suspect that censorship issues may have led to toning down what in real life would have been controversial bystander casualties.

The intensity of the stakes in “Drug War” also gets communicated in Koo’s and Sun’s intense performances. Koo’s Choi seems too quick and eager to turn his fellow cartel members in, leaving one to wonder if or when he will eventually betray the cops. Sun’s Captain Zhang has opaque motives regarding Choi’s fate. Will the captain allow his execution with the cartel’s defeat? Or might he possibly bend the law on Choi’s behalf?

What is certain is that in this war between two powerful opposing forces, both cops and criminals are evenly matched. The cops possess such official resources as high-tech street surveillance cameras and a grim dedication to their jobs. But the drug cartel’s members use concealed transmission devices and instantly portable chemical equipment to create their drugs.

Had To adopted David Simon’s view that the drug war was ultimately unwinnable, the censors would probably have insisted on changes to the film’s story. But by creating the ending he did, the resulting film glorifies only those who have survived the drug war.

(“Drug War” opens August 16, 2013 at the AMC Metreon (101—4th Street, SF) and the 4 Star Theatre (2200 Clement Street, SF). For further information on the film, go to )