More people overstayed their visas in 2017 than crossed into the United States illegally that year, the Department of Homeland Security said Tuesday.

DHS said almost 702,000 people who entered the U.S. legally last year didn't leave the country in time, and were deemed to be in the U.S. illegally. That's just a bit more than 1 percent of the 52.7 million people who came as students, or for business or personal reasons last year.

That's more than the 361,993 who tried to enter the U.S. illegally last year, most of whom tried to enter at the southwest border.

The nonimmigrant group with the highest overstay rate was student and exchange visa recipients. Four percent of the 1.6 million people who received those visas stayed past the expiration of their visa.

The total overstay number was broken down by Visa Waiver Program nations, which are countries whose citizens can go to the U.S. for up to 90 days without a visa, and non VWP countries.

DHS said that among citizens from the 38 VWP countries who were allowed to come and go without a visa, 0.51 percent — around 110,000 of the 22.5 million — overstayed. The rate of overstay from non-VWP countries was nearly four times higher, 1.91 percent.

About 1 percent of those who entered from Canada legally and were expected to leave last year did not, and the corresponding rate from Mexico was 1.6 percent.

Correction: This story was updated after mistakenly reporting that 526,901 people were apprehended for illegal entry. That number included inadmissibles, or those who applied to enter at one of the 48 ports of entry along the U.S.-Mexico border. Exactly 204,288 people tried to legally enter at a port but were denied.