BANGKOK — Rejecting arguments made by Myanmar’s civilian leader, Daw Aung San Suu Kyi, the International Court of Justice at The Hague ruled on Thursday that Myanmar must take action to protect Rohingya Muslims, who have been killed and driven from their homes in what the country’s accusers call a campaign of genocide.The court said Myanmar must “take all measures within its power” to prevent its military or others from carrying out genocidal acts against the Rohingya, who it said faced “real and imminent risk.” It also essentially put Myanmar under court oversight, telling it to submit regular reports to the tribunal explaining what steps it had taken.The decision is the first international court ruling against Myanmar over its military’s brutal treatment of the Rohingya. While the court has no enforcement power, any member of the United Nations can request action from the Security Council based on its rulings.The nation of Gambia brought the case to the tribunal, the United Nations’ highest court, in November on behalf of the 57-nation Organization of Islamic Cooperation. Gambia’s legal team asked the court to condemn Myanmar for violating the Genocide Convention. A ruling on that question could be years away.But Gambia also asked the court for more immediate action: a temporary injunction ordering Myanmar to halt all actions that could make the Rohingya’s situation worse, including further extrajudicial killings, rape, hate speech or the leveling of homes where Rohingya once lived. The tribunal held three days of hearings on that issue last month.The court, ruling in Gambia’s favor, ordered Myanmar on Thursday to ensure that Rohingya still in the country are not subjected to genocidal acts, including killing them, causing them serious bodily or mental harm, or deliberately imposing conditions meant to bring about the destruction of the Rohingya population.The court, headed by Judge Abdulqawi Ahmed Yusuf of Somalia, also ordered Myanmar to report back within four months on what steps it has taken, and to submit further reports to the court every six months after that for as long as the case remains open.Attorneys representing Myanmar and Gambia in The Hague could not immediately be reached for comment. Spokesmen for the military and for Ms. Aung San Suu Kyi also could not be reached.In 2017, Myanmar’s military, known as the Tatmadaw, waged a brutal assault against the Rohingya in the western state of Rakhine, prompting more than 700,000 to flee to neighboring Bangladesh, where they now live in squalid conditions in the world’s largest refugee camp.United Nations officials have said the military committed genocide. Investigators say thousands were killed. Surviving Rohingya have described such atrocities as the murder of children and the gang rape of women and girls by soldiers.About half a million Rohingya are still in Myanmar, also known as Burma, including about 100,000 people who were forced from their homes — some of them in waves of violence that preceded the 2017 campaign — and now live in camps. The Gambia legal team argued that they are in “grave danger” of further genocidal acts.A spokesman for the military, Gen. Myat Kyaw, said before the ruling that the military was not concerned about what the tribunal might decide. If presented with evidence of war crimes, he said, commanders will pursue them.“We will take action in accordance with the military judicial framework if there is a war crime,” he said. “What the Tatmadaw did was a just war. If individuals violated the law, we will take action by military court.”Earlier this week, a panel appointed by Myanmar’s government found that war crimes had indeed taken place during the 2017 campaign. But the so-called Independent Commission of Enquiry said it had found no evidence of “genocidal intent” in the military’s actions, which it said were in response to attacks by a rebel force, the Arakan Rohingya Salvation Army.“War crimes, serious human rights violations, and violations of domestic law took place during the security operations,” the commission said in its report on Tuesday. It said there was evidence that the security forces were involved in several mass killings of civilians, which may have claimed the lives of as many as 900 people.But it said it did not find credible statements to support the widely reported allegations of gang rape by the security forces.The panel called for further investigation and prosecution of human rights violations and war crimes. Human rights advocates said its report was an improvement over previous government investigations, but that it fell far short of its responsibility to uncover the truth and hold the military accountable.“The Myanmar commission’s report departs from longstanding government efforts to absolve the military of wrongdoing, but it’s still a major disappointment,” said Brad Adams, the Asia director at Human Rights Watch. “The government’s modest admissions of responsibility are just too little, too late.”Myanmar contends that the International Court of Justice has no jurisdiction in this case because Myanmar is not a party to the agreement that established the court. Gambia argues that the court has jurisdiction because the Rohingya were forced into Bangladesh, which is a party to the agreement.Ms. Aung San Suu Kyi, once a human rights icon who received the Nobel Peace Prize, traveled to The Hague in December to speak on Myanmar’s behalf at the hearings — essentially, defending the same military that kept her under house arrest for 15 years.At the hearings, Ms. Aung San Suu Kyi heard gruesome accounts of summary executions, babies thrown to their deaths, mass rapes and whole villages burned to the ground. When it was her turn to speak, she did not directly address those accusations, but told the court, “Genocidal intent cannot be the only hypothesis.”Throughout her argument, she avoided the term Rohingya, a word that Myanmar rejects because it implies the group’s legitimacy as an ethnic minority within Myanmar, a mostly Buddhist country. Most people in the country call them Bengalis, suggesting that they are interlopers from Bangladesh.Under the country’s military-drafted Constitution, the power of civilian leaders is sharply limited, and Ms. Aung San Suu Kyi has no control over the military and many other parts of the government. As she heads into elections at the end of this year, her dramatic court appearance at The Hague could help shore up support among voters and distract from her party’s poor economic performance.“The military who committed the crimes should thank her,” said Ko Win Hlaing, a taxi driver who helped organize a rally to support Ms. Aung San Suu Kyi last month in the city of Mandalay.“You might see the critics of Aung San Suu Kyi on Twitter because international communities are mostly on Twitter,” he added. “But on Facebook, most people support her and I’m sure her party will win again in coming elections. I feel that she is the real mother of our country.”Saw Nang contributed reporting from Mandalay, Myanmar, and Marlise Simons from Sydney, Australia.