Aung San Suu Kyi spent the best part of two decades under house arrest when a military junta ruled Myanmar. This week in The Hague, the Nobel laureate and former democracy campaigner will defend some of the same generals and her country against allegations of genocide .

To many in the West, Suu Kyi’s decision to personally defend Myanmar’s purge of the Rohingya is indefensible. As civilian head of a government still under heavy military influence, she supported the army and its campaign against the mostly Muslim minority, forcing the United States, Britain and others to reassess a leader they spent years lionizing.

In Myanmar, however, the move has solidified Suu Kyi’s hero status ahead of elections next year, underscoring the abhorrence that many in the Buddhist-majority country feel toward the Rohingya, as well as domestic considerations that make her appearance politically expedient.

As she departed for the United Nations’ top court, tens of thousands attended rallies in Myanmar to support her mission, waving placards and chanting in adoration. Some planned to fly to the Netherlands. A religious ceremony was held in her honor at a pagoda named for eternal peace.

The military’s operation against the Rohingya in Rakhine state forced almost a million people into squalid camps in neighboring Bangladesh amid allegations of rape, indiscriminate killing and torture. Legal experts say the country now faces a reckoning that could implicate Suu Kyi, although a judgment will likely take years.

“It’s the first time that they have to answer for the military’s atrocities in Rakhine state in a credible court,” said Param-Preet Singh, associate director of the International Justice Program at Human Rights Watch.

The case at the International Court of Justice was brought by Gambia, the smallest country in continental Africa, with the backing of the 57-member Organization of Islamic Cooperation. Gambia’s move is a rare example of state-to-state litigation between U.N. member states, and the first time a country without direct connection to the alleged atrocities has brought a case before the ICJ.

“It took a tiny country like Gambia to give a shot at justice,” Singh said. “None of the big powers have been able to do that. It’s an unlikely hero that’s unlocking a door, and it’s created this path that didn’t exist before.”

This week’s hearings are among several international legal maneuvers to hold Myanmar officials to account. In November, the International Criminal Court’s judges authorized prosecutors to open an investigation into crimes against humanity over the treatment of the Rohingya.

A striking feature of the proceedings is the appearance of Suu Kyi. Her defense, scheduled for Wednesday, will mark one of the only times a national leader has personally addressed the tribunal, which first met in 1946.

Analysts and those familiar with Suu Kyi’s thinking say domestic considerations largely explain her resolve to testify in person. These include a desire to bolster her personal support and that of her party, and to placate the military, which holds sway over key ministries and has balked at proposed constitutional changes that would revoke its enshrined role in politics and officially allow Suu Kyi to become president.

These people say Suu Kyi perceives herself as the only one who can, and should, do the job of confronting international opprobrium.

“Aung San Suu Kyi believes both that she is the person best able to present Myanmar’s case at The Hague, and, as foreign minister, the person who is most responsible for doing so,” said Richard Horsey, a political analyst based in Yangon. “She no doubt understands the importance of this moment for Myanmar’s international standing but will also have one eye on her domestic audience.”

The state newspaper, the Global New Light of Myanmar, in announcing Suu Kyi’s departure on Sunday said she would contest the case “to defend the national interest.” Myanmar’s leaders have said international courts have no jurisdiction over the matter and have pushed back against the notion of any premeditated campaign against the Rohingya. The leaders have argued that they were instead responding to a security threat posed by militants.

Kobsak Chutikul, a retired Thai lawmaker and diplomat who served on an advisory board assembled by Suu Kyi after the Rohingya crisis, said her decision seemed to catch military leaders off-guard, so much so that they held a special “national security session” to get everyone on the same page.

“It thus bears the hallmarks of advice given by her close-knit inner circle of under-the-radar Western advisers who may have been more concerned with international image and perception issues,” he said. “They would have advised her to ‘get ahead of the narrative,’ ‘get it out there,’ and to use her power of celebrity to smother critics and accusers.” Also, “the military now also owes her one,” Kobsak added.

The gambit is a risky one as the international community pursues ways to hold Myanmar accountable. The U.S. House of Representatives in 2018 overwhelmingly voted for a resolution that declared the expulsion of the Rohingya to be genocide. In July, the State Department announced sanctions against military leaders including commander in chief Min Aung Hlaing, accusing them of “gross violations of human rights.”

So far, punitive measures have not targeted Suu Kyi, who enjoys a close relationship with Senate Majority Leader Mitch McConnell (R-Ky.).

Whether Suu Kyi’s calculations will play out as she hopes is “questionable at best,” said a former senior Western diplomat who worked closely with her.

“In the end, going to The Hague is very risky, perhaps implicating her in mass atrocities in the international mind more deeply than before,” he said.

For Rohingya refugees and those still in Myanmar — where they are segregated, denied citizenship rights and restricted in their movements — the proceedings are cause for cautious optimism. Rohingya inside Myanmar, also known as Burma, are finding ways to live-stream the coverage on spotty Internet connections. Those in Bangladesh, affected by an Internet shutdown, are finding it harder to obtain news but say they have hope for the first time in years.

“We have lost our hope and faith in the Myanmar government, [but] we have some hope now finally in the ICJ,” said Khin Maung, co-founder of the Rohingya Youth Association based in the Bangladesh camps.

Mahtani reported from Hong Kong and Birnbaum from Brussels. Cape Diamond in Yangon, Myanmar, contributed to this report.