LONDON — “The calamities of a people are the gifts of another.” So says an Arabic expression common in Sudan that could easily be the country’s motto. Tragic events have a knack for conspiring to extend the longevity of the Sudanese regime — or rather, the Sudanese regime has a knack for leveraging tragic events to stay in power.

The latest calamity to benefit the government of Omar al-Bashir, who became an international pariah when he invited Osama bin Laden and other terrorists to Sudan in the 1990s and later earned the distinction of being the first sitting head of state indicted by the International Criminal Court for crimes committed in Darfur, is the massive refugee crisis gripping Europe. In exchange for cooperating with the European Union to halt the movement of migrants and refugees through Sudanese territory, Bashir’s government is being quietly invited in from the cold.

For almost three decades, Khartoum has faced crippling U.S. and EU sanctions. And since his ICC indictment in 2009, Bashir has been a fugitive from justice in much of the world — only able to visit a handful of countries in Africa and the Persian Gulf without fear of arrest. Now Bashir’s government is set to receive a generous chunk of the EU’s $2 billion “Emergency Trust Fund for Africa,” which aims to combat migration at its source by promoting development and strengthening border security. For Sudan, the refugee crisis has been a godsend.

For a combination of reasons — its strategic location next to Libya and Egypt, its largely ungoverned hinterland, and its porous borders — Sudan has become a major transit hub for refugees and migrants from Eritrea, Ethiopia, and Syria who are hoping to reach Europe. Historically, the Sudanese government has been rather relaxed about migration through its territory. But presented with the carrot of EU funds, and the possibility of normalization of relations with European nations, it has suddenly become far more disciplined about policing the movement of people within its borders.

Refugees in Sudan say officials who previously accepted bribes from people on the move now appear unwilling to do so, and Khartoum’s notoriously chaotic police force has suddenly gotten more organized when it comes to apprehending migrants, particularly from Eritrea. In May, close to 1,000 Eritreans were reportedly rounded up in Khartoum and either taken to prisons there or deported back to Eritrea. Then in June, Sudan captured Mered Medhanie, an Eritrean smuggler thought to be responsible for the 2013 drowning deaths of almost 400 migrants near the Italian island of Lampedusa, and extradited him to Italy.

This awakening of good global citizenship was no coincidence. In April, Neven Mimica, the EU commissioner for international cooperation and development, formally announced a roughly $110 million aid package to Sudan through the Emergency Trust Fund for Africa, ostensibly earmarked for reducing poverty, creating jobs, and improving the delivery of basic services in marginalized and conflict-affected areas. “Our new support of [$110 million] will essentially focus on improving the living conditions for those who call Sudan home, helping returnees to the country to reintegrate back into society, and improving security at the borders,” Mimica said in a statement.

Mimica surely hoped the world would take note of the first two items he highlighted, but it is the last one — border security — that prompted the uneasy rapprochement with Brussels in the first place and has absorbed the bulk of the funds. In May, Der Spiegel and the New Statesman obtained secret documents revealing that the EU had earmarked funds to train Sudanese border police and planned to provide equipment such as cameras, scanners, and servers to the Sudanese government so it can register incoming refugees and build two closed “reception centers” in the eastern towns of Gadaref and Kassala. It’s not clear if these funds were part of the $110 million aid package announced in April or part of a separate $45 million grant, also from the Emergency Trust Fund, that the Sudanese government is set to receive a portion of in exchange for managing migration. Either way, Sudan is effectively being funded to stanch the flow of migrants and refugees to Europe — and to build open-air prisons to house them.

It’s an unsavory deal for Europe to say the least. Outsourcing the management of migrant routes to a cash-strapped government with a miserable human rights record will not only mean more suffering for desperate migrants and refugees. It will strengthen a regime whose demise many wish to hasten, including, presumably, European countries whose sanctions have cut Khartoum off from international financial markets. A spokesperson for the EU’s Directorate-General for International Cooperation and Development was quoted by the news service IRIN as saying the Emergency Trust Fund for Africa was “designed to improve migration management” and that “no funding will be channeled through the beneficiary countries’ government structures.”

This statement is misleading at best and at worst an outright lie. In countries like Sudan, where the line between public and private is often blurred, money does not have to travel through official channels to reach government pockets. Even if funds are only disbursed to nonprofits and other private partner organizations, the Sudanese government will control every aspect of the process, right down to who gets to bid for construction tenders and contracts to install and operate the surveillance equipment. There is little accountability or transparency when it comes to the Sudanese government’s fiscal policies, and it’s hard to imagine the EU looking too closely at the money trail, so long as the migration route via Sudan is effectively patrolled and sealed off.

Moreover, the entities that will enforce the new migration measures designed by the EU — the police, the border control, and the so-called Rapid Support Forces (RSF) — are very much a part of the government. A paramilitary force that supports the beleaguered Sudanese army, the RSF in particular stands accused of horrific human rights abuses, including extrajudicial killings, torture, and mass rape. It was formed in 2013 from elements of the janjaweed, the notorious militias that carried out the government’s genocide in Darfur, and answers directly to the National Intelligence and Security Service. The idea was to create a nimble and decisive force to address the country’s regular rebel uprisings and serve as a bodyguard for the central government. RSF troops regularly patrol Khartoum, a city that is increasingly becoming a garrison town, securing it against potential rebel attacks — and now enforcing immigration policies dreamed up in Brussels.

It is troubling that those who perpetrated the Sudanese government’s crimes in Darfur now form Europe’s first line of defense against unwanted refugees. But even more troubling is the fact that the EU is now arming Khartoum with international credibility at a time when its domestic legitimacy is arguably at an all-time low. Cash-strapped because of low oil prices and sullied in the eyes of many of its citizens by its brazen use of extrajudicial killings and detentions, Sudan is facing its largest student protests in recent memory — protests that at times have devolved into bloody clashes with security forces. But instead of amplifying the pressure on Bashir by calling out his abuses, European governments are quietly letting his government escape its previous international isolation. In June, for instance, Marta Ruedas, the U.N. resident and humanitarian coordinator for Sudan, paid Bashir a visit at the presidential guesthouse in Khartoum. She was the highest-ranking U.N. official to meet with the president for several years. Mimica himself visited Sudan and met with the first vice president, as well as Sudanese officials in the ministries of International Cooperation, Foreign Affairs, and Interior. Presumably, a visit with the president was still a bridge too far — optically at least.

This is not the first time that a foreign tragedy has proved a boon to the Sudanese regime. After the 9/11 terrorist attacks, Bashir’s government began quiet but close cooperation with the United States on intelligence. In exchange, Khartoum gained additional leverage over U.S. sponsored peace negotiations with southern Sudanese rebels, as well as promises of sanctions relief once South Sudan achieved independence in 2011. The United States backed away from its promise of sanctions relief after new conflicts erupted in 2011 in Sudan’s Blue Nile and South Kordofan states, but it continued to work closely with Sudanese intelligence officials. Today, in private, many U.S. officials say they’d like to remove Sudan from the U.S. state sponsors of terrorism list, a move that has proved politically impossible to date.

Now Sudan has a new set of bargaining chips: desperate refugees willing to risk their lives to get to Europe. It’s unlikely that all or even most of the sanctions will be lifted anytime soon — the optics are still too bad for most Western powers — but cooperation on the refugee front is a clear first step toward rehabilitation for Bashir. If Sudan is coming in from the cold, however, the Sudanese people will remain stranded on the outside for the foreseeable future, bearing the brunt of international sanctions until they are lifted and the brutality of their government long after that.

EBRAHIM HAMID/AFP/GettyImages

Nesrine Malik is a Sudanese columnist and features writer based in London. Twitter: @NesrineMalik