Apple CEO Tim Cook gestures after opening the newly renovated Apple Store at Fifth Avenue on September 20, 2019 in New York City.

Lawmakers from both parties in the House and Senate criticized Apple CEO Tim Cook on Friday for "censorship" at the behest of China.

The politicians were referring to an episode last week in which Apple removed an app called HKmap.live used by people during the pro-democracy protests to identify where roadblocks or police activity was taking place. Apple said at the time that it had been used to "ambush police" and that it violated Hong Kong law.

The letter was signed by Senators Ted Cruz (R-TX), Ron Wyden (D-OR), Tom Cotton (R-AR) and Marco Rubio (R-FL). It was signed by Representatives Alexandria Ocasio-Cortez (D-NY), Mike Gallagher (R-WI), and Tom Malinowski (D-NJ).

"We write to express our strong concern about Apple's censorship of apps, including a prominent app used by protesters in Hong Kong, at the behest of the Chinese government," they wrote in the letter.

"You have said publicly that you want to work with China's leaders to effect change rather than sit on the sidelines and yell at them," the letter said. "We, too, believe that diplomacy and trade can be democratizing forces. But when a repressive government refuses to evolve or, indeed, when it doubles down, cooperation can become complicity."

The letter also mentions a 2017 episode in which several virtual private network apps used by some to circumvent the Chinese content firewall were removed from Apple's App Store. Cruz criticized Apple at the time in a letter and series of questions.

Apple has extensive business in China. It recorded $51 billion of its total $265.6 billion in revenue in 2018 from "Greater China," which includes Hong Kong and Taiwan. Its supply chain that produces over 200 million iPhones per year is also largely based in China. Cook met with a Chinese administrator on Thursday, according to Reuters.

Apple didn't immediately return a request for comment.

WATCH: A look at how Apple is pricing its iPhone 11 in China