Guatemala is the cornerstone of President Donald Trump’s "safe third country" agreement — an effort to stem migration to the U.S. by first requiring people to claim asylum in Guatemala before applying to the United States.

But experts say that the most effective tool in reducing migration from Latin America is strengthening the rule of law and human rights in the region through anti-corruption commissions like the one that will end in Guatemala on Sept. 3.

The International Commission Against Impunity in Guatemala (widely known by its Spanish acronym, CICIG) was created in 2006 to help prosecutors investigate and dismantle criminal organizations that had weakened and manipulated Guatemala’s judicial and political systems.

“The CICIG has been a very successful law initiative. And for the U.S., a good bang for its buck,” said Adriana Beltrán, director of citizen security for the Washington-based advocacy and research organization WOLA.

Beltrán said the U.S. has invested millions since Guatemala’s peace accord in 1996," and the return was minimal."

"You still had extremely high levels of impunity, and no real access to justice," she said. "But within the last 10 years, you can point to specific progress that has had an impact on corruption and migration.”

Backed by the United Nations and funded by different countries — the U.S. gave $44.5 million from 2007 to 2017 — CICIG helped prosecutors take on military death squads, rogue police officers, drug cartels and even two presidents — Alfonso Portillo was convicted on money laundering charges in 2014, and Otto Pérez Molina was jailed in 2015 for a corruption scandal involving customs agents, importers and officials who lowered import taxes in exchange for fees.

More recently, CICIG prosecutors investigated Guatemala’s outgoing president Jimmy Morales — who signed Trump’s safe third country agreement — for accepting roughly $1 million in campaign donations. And in retaliation, Morales refused to renew the commission’s agreement, which expires next week.

Now, Beltrán says that if the CICIG comes to an end, criminal organizations will try to regain control of the Guatemalan government. And this will have many repercussions on security conditions and the economy, which will ultimately result in more waves of undocumented migration to the United States.

“There is a link between corruption and migration,” Beltrán told NBC News. “When you talk about corruption and Guatemala, we’re not talking about a few bad apples or one administration. It’s a machinery that has been created to favor a certain few at the expense of the majority. And the most affected tend to be marginalized communities living in areas where the state is barely present.”

Security experts say that the international commission ushered a deep cultural change in the Central American country — a poll during the 2019 presidential campaign said that the majority of Guatemalan voters supported the anti-corruption mission of the CICIG over their government and politicians.

But after the conservative Alejandro Giammattei won Guatemala’s presidency on Aug. 11, experts say that it signals a wider political shift in the region that favors “mano dura” (hard-line) politics over the CICIG’s mission to strengthen the rule of law and democratic institutions. Giammattei, a former prison director, has already proposed bringing back the death penalty.

“Since President Trump took office, the United States has backed away from the strong support that it traditionally offered human rights and justice initiatives in Guatemala and the Americas,” said Kate Doyle, a senior analyst for the National Security Archive who uses declassified U.S. records on Guatemala and Latin America to uncover hidden foreign policy stories. “That is a signal that says that this is no longer a priority. And it’s being heard and received by conservative and populist governments all over the Americas.”

In May 2018, Senate Republicans suspended annual CICIG funding ($6 million) from the U.S. government for several months. And in September 2018, the U.S. refused to back a joint statement issued by CICIG donor countries supporting the commission’s anti-corruption work.

Before this political shift, the CICIG had become a model for neighboring countries in the region — including Honduras, El Salvador and Mexico — that sought to strengthen their governments against corruption.

“Civil society organizations, justice reform organizations and good government organizations in different Central American countries have been putting their heads together to see whether a CICIG-like commission is a good model to strengthen their national justice systems and prosecutorial capacity,” Doyle told NBC News.

Now, Doyle believes that right wing populism is driving governments away from justice reform initiatives and human rights work that had become a cornerstone of foreign policy in the region after the Cold War ended.

Experts also see this shifting political landscape as undermining crucial U.S. cooperation.

“The fascinating thing about the CICIG is that it had been reviving bipartisan support by Congress and with successive administrations,” Beltrán said. “I think the Bush administration at the time saw real value in an international commission of that nature to go after criminal groups that were engaged in all kinds of illicit activities.”

Follow NBC Latino on Facebook, Twitter and Instagram.