BANGKOK — The United States has imposed sanctions on Myanmar’s top military commander, Senior Gen. Min Aung Hlaing, and three of his highest-ranking generals for their roles in the atrocities carried out against Rohingya Muslims since 2017, Secretary of State Mike Pompeo announced.

The four generals and their immediate family members will be barred from entering the United States, Mr. Pompeo said on Tuesday. “With this announcement, the United States is the first government to publicly take action with respect to the most senior leadership of the Burmese military,” he said in a statement.

Two years ago, brutal attacks by the military and Buddhist mobs in Rakhine State in western Myanmar, which included murder, rape and arson, forced more than 700,000 members of the Rohingya ethnic minority to flee across the border into Bangladesh, where they have been living ever since in squalid refugee camps.

The United Nations has labeled the attacks genocide, saying that General Min Aung Hlaing and other top generals should face trial in an international court. But until now, no action has been taken against them.