WASHINGTON — Thousands of immigrants with criminal convictions, including for assault and attempted murder, have been released from detention because their native countries refused to take them back, according to statistics recently released by the Department of Homeland Security.

The inability to deport the criminals has prompted outrage among lawmakers and advocates of tighter immigration laws, who say that the Obama administration could be doing much more to pressure uncooperative countries.

But the department faces a number of obstacles. It is legally barred from indefinitely detaining immigrants who cannot be repatriated. And poorer nations are often reluctant to take back violent offenders because they have limited resources to deal with them.

The release of such immigrants into American cities is a particularly charged aspect of the national debate over immigration. Donald J. Trump, the presumptive Republican presidential nominee, has painted a grim picture of immigrant criminals menacing the streets.