BEIJING — For seven years, the young Swedish man had directed a nongovernmental organization in Beijing that offered legal aid to Chinese citizens in trouble. Now he was a captive of China’s legal system, forced in police detention to speak on video about his so-called crimes.

“I have violated Chinese law through my activities here,” Peter Dahlin, 35, said in the video aired Tuesday night by China Central Television, the official state network. “I have caused harm to the Chinese government. I have hurt the feelings of the Chinese people. I apologize sincerely for this, and I’m very sorry that this ever happened.”

The video followed similar jailhouse confessions by a Swedish publisher, Gui Minhai, two days earlier, and two other foreigners, Peter Humphrey and Charles Xue, in 2013.

Though foreigners in China have long been forced to make back-room confessions when detained by the police, this recent string of televised self-criticism, under the hard-line rule of President Xi Jinping, has struck many people here as remarkable because of the manner in which the videos were used as Communist Party propaganda for an audience of hundreds of millions. For many, they evoked Mao-era public self-criticism sessions. There have been notable televised confessions by Chinese, too.