A bomb exploded outside the US embassy in Beijing, wounding the lone assailant, the embassy said in a statement, but police described the weapon merely as a "firework device".
The explosion happened on the street outside southeast corner of the embassy compound, the embassy said.
Police said the suspect, a 26-year-old man from China's Inner Mongolia region, had injured his hand and been taken to hospital.
Police did not provide a motive.
China and the United States have been involved in an escalating trade dispute initiated by Washington after the two sides imposed tariffs on $34 billion worth of each other's goods, with US President Donald Trump threatening ultimately to impose punitive tariffs on all Chinese imports.
While Chinese officials and state media have been outspoken in their criticism of US trade moves, there has not been a groundswell of outrage on China's heavily censored social media, and no reported boycotts of US goods.
Witnesses told Reuters that they heard an explosion near the embassy and felt tremors.
"I'd just arrived and started to queue and then heard a loud explosion about 100 metres away," one witness said.
He said the blast happened shortly after 1pm local time as he queued to apply for a US visa to take an exam in Los Angeles.
A police SUV appeared to have been damaged, with its back window missing, and was cordoned off by police before being removed, a Reuters witness said.
The embassy resumed normal operations at about 1.45pm, it said.
Crowds were still queueing outside the embassy after the explosion and traffic was moving as normal in an area of northeastern Beijing that is home to numerous embassies including those of France, India and Israel.
Postings on social media showed pictures of smoke close to where people line up outside the compound for visa appointments. Some video clips and images were later removed.
There was no damage to US embassy property, the embassy said.
The state-run Global Times reported separately, citing a witness, that police took away a woman who sprayed herself with gasoline in a suspected self-immolation attempt outside the embassy at around 11am.
Police did not immediately reply to a request for comment.