China is investigating protesters’ harassment of the U.S. ambassador as he attempted to enter the American Embassy, and U.S. officials say Beijing has expressed regret for the incident.

About 50 protesters spilling over from demonstrations at the nearby Japanese Embassy surrounded the car of U.S. Ambassador Gary Locke on Tuesday, tried to block him from entering the embassy compound and ripped the car’s flag.

Video shot by prominent Chinese artist Ai Weiwei and posted to his YouTube channel showed the protesters marching to the compound entrance just as Locke was arriving, then throwing small objects at his car before Chinese security forces broke up the crowd.

Locke told reporters Wednesday that Chinese authorities were “very quick” to move the demonstrators away. “It was all over in a matter of minutes, and I never felt in any danger,” he said.

There have been angry demonstrations across China following the Japanese government’s decision last week to purchase some disputed East China Sea islands from their private Japanese owners. Tuesday’s protests also marked the 81st anniversary of Japan’s invasion of China, an emotional remembrance that stoked the outrage.

The U.S., a close ally of Japan, has said it is staying out of the dispute over the islands.

State Department spokeswoman Victoria Nuland said the U.S. has registered its concern with China both in Washington and Beijing, and Chinese authorities have expressed regret over the incident.

Nuland said the preliminary U.S. assessment was that the car was “a target of opportunity” for protesters who had gathered outside the nearby Japanese Embassy.

The incident came amid heightened vigilance for American diplomats following violent attacks on U.S. embassies in Libya, Yemen and Egypt. The embassy in Beijing said it has asked China’s government to do everything possible to protect American facilities and personnel.

The anti-Japan demonstrations, which have included attacks on businesses tied to Japan, have wound down, at least temporarily. Chinese police cleared roadblocks and some Japanese businesses reopened.

Still, there has been no progress in resolving the territorial dispute bedeviling relations between the two Asian economic powerhouses.

The rhetoric on both sides has remained uncompromising.

China’s future leader, Xi Jinping, told visiting U.S. Defense Secretary Leon Panetta on Wednesday that Japan’s purchase of the islands was a farce, according to the official Xinhua News Agency.

“Japan should rein in its behavior and stop any words and acts that undermine China’s sovereignty and territorial integrity,” Xinhua quoted Xi as saying.

In Tokyo, former Japanese Defense Minister Shigeru Ishiba said losing a piece of Japan would mean “losing the whole country.”

The islands – called Senkaku in Japan and Diaoyu in China – are tiny rock outcroppings that have been a sore point between China and Japan for decades. Japan has claimed the islands since 1895. The U.S. took jurisdiction after World War II and turned them over to Japan in 1972.

Japan’s government sees its purchase of some of the islands as a way to thwart a potentially more inflammatory move by the governor of Tokyo, who had wanted not only to buy the islands but also develop them. But Beijing sees Japan’s purchase as an affront to its claims and its past calls for negotiations.

Beijing has sent patrol ships inside Japanese-claimed waters around the islands, and some state media have urged Chinese to show their patriotism by boycotting Japanese goods and canceling travel to Japan.

The islands are important mainly because of their location near key sea lanes in the East China Sea. They are surrounded by rich fishing grounds and as-yet untapped underwater natural resources.

Chinese state media have also reported that boats were headed to the waters around the disputed islands for seasonal fishing.

Hong, the foreign ministry spokesman, said such activities were within China’s rights.

“The Diaoyu Islands have belonged to China since ancient times,” he said. “It is totally legitimate and reasonable for Chinese fishing vessels to fish in relevant waters.”

—

Associated Press writers Lolita Baldor in Beijing, Malcolm Foster in Tokyo and Matthew Pennington in Washington contributed to this report.