WASHINGTON — The Justice Department is preparing to release roughly 6,000 inmates from federal prisons starting at the end of this month as part of an effort to ease overcrowding and roll back the harsh penalties given to nonviolent drug dealers in the 1980s and ’90s, according to federal law enforcement officials.

About a third of the inmates are undocumented immigrants who will be deported. Because many of those inmates were convicted of crimes that are significant legal offenses, President Barack Obama is unlikely to be criticized as sharply for their release by those who have objected to past deportation decisions by the administration.

The release will be one the largest discharges of inmates from federal prisons in American history. It coincides with an intensifying bipartisan effort to ease the mass incarcerations that followed decades of tough sentencing for drug offenses, like dealing crack cocaine, and that have taken a particularly harsh toll on minority communities.

“Today’s announcement is nothing short of thrilling because it carries justice,” said Jesselyn McCurdy, a senior legislative counsel at the American Civil Liberties Union. “Far too many people have lost years of their lives to draconian sentencing laws born of the failed drug war. People of color have had to bear the brunt of these misguided and cruel policies. We are overjoyed that some of the people so wronged will get their freedom back.”

While news of the early releases was widely praised, it raised some concerns among law enforcement officials across the country who are grappling with an increase in homicides. Their fear is that many of the freed convicts will be unable to get jobs and will return to crime.