The number of immigrants apprehended for illegally crossing the southwest border has dropped for the second month in a row, the Department of Homeland Security announced on Wednesday.

In July, a total of 31,303 people were apprehended at the border after illegally crossing into the United States, a more than 8 percent decrease from the previous month, according to statistics released by U.S. Customs and Border Protection. But the number of families who were caught or turned themselves in after crossing between official ports of entry stayed flat, declining by less than 1 percent.

Homeland Security Press Secretary Tyler Houlton hailed last month's numbers as evidence that the Trump administration’s recent crackdown at the border has deterred immigrants from trying to cross into the country illegally.

“This decrease shows that when there are real consequences for breaking the law, the conduct of those considering crimes will change,” Houlton said in a statement. “In the month of July, we saw a decrease in illegal border crossings because human traffickers and Transnational Criminal Organizations were put on notice that this Administration was increasing prosecutions of those entering the country illegally.”

But Houlton noted that the number of families apprehended after crossing the border "remains high" and blamed "court decisions [that] prevent us from detaining and prosecuting family unit adults." The Trump administration moved to separate thousands of immigrant families at the border in June, but public outcry caused the president to halt the separations on June 20. Less than a week later, a judge blocked future separations and ordered the reunification of families affected by the policy.

In June, the number of apprehensions for illegal border crossing dropped by more than 15 percent compared to May.