Even as the number of new foreign students enrolling in U.S. postsecondary schools has fallen for the past two school years, the number of international students and graduates on a controversial work permit has hit record levels, according to a new report.

In the 2017-18 school year, the number of active Optional Practical Training (OPT) permits — widely seen as an alternative to the hard-to-get H-1B visa — broke the 200,000 mark for the first time, the Institute of International Education reported this month.

The OPT allows foreign students and graduates to work in the U.S. for 12 months, and an additional two years if they're in science, technology, engineering or math fields.

Meanwhile, the number of new foreign students enrolling in U.S. schools fell in 2017-18 to 271,738, after dropping the previous year from a high of around 300,000 in 2015-16, data show.

Although OPT numbers are moving in the opposite direction, it appears that growth of that work permit has slowed. The 203,462 active OPT permits in the 2017-18 school year represented a 16 percent increase over the year before. But number increased in the previous two years before by 19 percent and 23 percent.

Pew Research reported in July that last year's OPT growth was the slowest since 2004.

The administration of President Donald Trump has set its sights on the work permit. In January, U.S. Citizenship and Immigration published new rules requiring OPT holders to work directly for their employer, where authorities can conduct inspections — not for third-party clients of an employer.

The OPT program has grown larger than the program for H-1B visas, which are subject to an annual 85,000 cap on new visas, Pew reported in May. Since 2008, when a STEM extension was granted, the OPT has grown 400 percent, according to Pew.

The H-1B, heavily relied upon by Silicon Valley tech giants and criticized for reported abuses, has also become a target for the Trump administration. Federal agencies have said they plan to strip work authorization from spouses of H-1B workers on track to get green cards, and they plan to change the H-1B lottery to favor more highly educated workers.

Industry group Compete America, which represents companies including Google, Facebook, Cisco, Hewlett-Packard Enterprise, Oracle, Salesforce, Amazon, Microsoft, IBM and Walmart, and outsourcing and consulting firms Accenture and Deloitte, said this month that its members were reporting a dramatic increase in the number of H-1B applications denied or delayed.

The International Education Institute produced the foreign-student data in collaboration with the U.S. Department of State, which stated its strong support for international-student enrollment in U.S. schools.

"International students studying alongside Americans are a tremendous asset to the United States," Marie Royce, assistant secretary of state for educational and cultural affairs. "We need to develop leaders in all fields who can take on our toughest challenges. We need people who can find solutions that keep us secure and make us more prosperous. We want to send a message that international education makes us stronger as a country."

The top academic fields for foreign students in the U.S. in 2017-18 were engineering, business and management, and math and computer science, the institute reported.