Starring Keira Knightley, Helen Mirren and Luke Wilson, “Berlin, I Love You” is part of the Cities of Love franchise, in which international directors are invited to make short, intersecting vignettes that take place in a particular city.

Claus Clausen and Edda Reiser, two of the film’s producers, confirmed Mr. Ai’s account, adding that they had fought to keep his segment in the film but ultimately felt they had no choice but to remove it.

“Some of the distributors just told us: ‘Frankly, we are not taking the movie with him in it,’” Mr. Clausen said, referring to Mr. Ai. “We were really, really desperate. No matter what decision we made, we were going to lose.”

“In the end, we were heartbroken,” he added.

It is the latest example of how China’s vast censorship apparatus and economic strength extend Beijing’s influence far beyond the country’s borders. In recent years, China has exercised considerable influence over how it is portrayed in Hollywood movies.

Mr. Ai, one of China’s best-known artists, who now lives in Berlin, has long been an outspoken critic of the Chinese government. In 2011, he was secretly held for 81 days in a rural Chinese detention center.