BEIJING  Apparently unnerved by an anonymous Internet campaign urging Chinese citizens to emulate the protests that have rocked the Middle East, Chinese authorities this week have begun a forceful and carefully focused clampdown on activities by foreigners that the government deems threatening to political stability.

Public security officials have summoned dozens of foreign journalists in Beijing and Shanghai to be dressed down on videotape, warning them that they had broken reporting regulations by visiting locations that had been selected as protest sites in Internet postings. Journalists were bluntly warned that they faced the loss of their visas, revocation of their credentials and expulsion if they did not abide by new limits on their ability to interview and photograph Chinese citizens, the Foreign Correspondents’ Club of China said in a statement.

In Shanghai, the authorities objected to the location of an annual St. Patrick’s Day parade set for March 12 that had been expected to draw more than 2,000 people, prompting Irish organizations to abruptly cancel the event on Monday. The parade was to have taken place on a major street close to a cinema where the Internet postings had urged people to gather every Sunday to show their displeasure with the Chinese government.

Western diplomats in China said other events that had been planned by foreigners, or with their help, had also been abruptly canceled. “We’ve noticed that a somewhat larger number of our cultural and educational programs around China are being postponed or canceled, but we haven’t been notified by Chinese authorities of any specific reason,” said one diplomat, who spoke on the condition of anonymity.