STOCKHOLM — Residents in a northwestern suburb predominantly inhabited by immigrants have clashed with police officers, two days after President Trump unleashed a vague but pointed critique of Sweden’s migration policies.

About 20 to 30 masked men threw stones and other objects at police officers in the suburb, Rinkeby, after the police arrested a man on suspicion of dealing drugs. A police officer fired at the perpetrators but did not strike anyone, and the disturbances continued for several more hours, stretching into early Tuesday morning. A photojournalist was injured in the clashes. (The police initially classified the gunshot as a warning shot.)

The episode drew scrutiny worldwide because of Mr. Trump’s assertions — based on a Fox News segment — that Sweden had experienced a surge in crime and violence as a result of taking in large numbers of refugees. Mr. Trump’s comments were greeted with anger in Sweden, the latest example of strong criticism by the American president antagonizing friendly countries, including neighbors like Mexico and allies like Australia and the European Union.

Swedish officials criticized Mr. Trump’s statements about crime in the country as exaggerations. Preliminary statistics do not show a major increase in crime from 2015, when the country processed a record 163,000 asylum applications, to 2016. Disturbances like the one in Rinkeby, officials said, are not unprecedented but are infrequent. In 2013, the police shooting of a man wielding a knife led to nights of violence in the suburbs of Stockholm, including Rinkeby.