The U.S. continues to run an educational trade surplus. Nearly 820,000 international students were enrolled at U.S. colleges and universities in the 2012-13 year, compared with 283,332 U.S. students studying abroad, according to a new report from the Institute of International Education, a New York-based nonprofit that manages dozens of study-abroad programs.

Both figures represent record highs, according to the institute’s 2013 “Open Doors Report on International Educational Exchange.” In the last academic year, 55,149 more international students were studying in the U.S. than in 2011-12, a 7.2% increase. Over that same period, the number of American students studying overseas grew 3.4%, or 9,336 students. There are now 40% more international students studying in the U.S. than a decade ago, the institute found. International students make up nearly 4% of total undergraduate- and graduate-level enrollment.

China was by far the leading source of foreign students in the U.S. — 235,597 students, or 28.7% of the total — followed by India (11.8%), South Korea (8.6%) and Saudi Arabia (5.4%). Most of the year-over-year growth was driven by China (up 21.4% from 2011-12) and Saudi Arabia (up 30.5%).

The United Kingdom was the most popular study-abroad destination for U.S. students, with 12.2% going there in the 2011-12 academic year, followed by Italy (10.5%), Spain (9.3%) and France (6.1%).

Drew DeSilver  is a senior writer at Pew Research Center.