BEIJING — China’s ruling Communist Party banned television dramas about politics and corruption from prime time more than a decade ago, apparently worried that they reflected reality a little too well. But its propagandists let loose this spring with “In the Name of the People,” a slick, ostentatious, 55-episode series that has been called a Chinese version of “House of Cards.”

Assassins conspire to kill government investigators. Bribetaking officials flee the country to escape punishment. Scheming judges are caught in bed with foreign mistresses — and Chinese audiences are loving it. Ratings have been through the roof, and the show has garnered billions of views online, becoming one of the most popular television programs in Chinese history.

Despite this focus on bad behavior, “In the Name of the People” largely glorifies the party’s anticorruption efforts, portraying government investigators as folk heroes up against nefarious forces. This approach dovetails with the corruption crackdown that President Xi Jinping has used to cement both his grip on power and his own popularity.