Islamic State has been using a well-stocked university chemistry lab in Mosul, Iraq, for the past year to concoct a new generation of explosive devices and train militants to make them, according to U.S. and Iraqi military officials and two people familiar with the university.

Gen. Hatem Magsosi, Iraq’s top explosives officer, said the facilities at the University of Mosul have enhanced Islamic State’s ability to launch attacks in Iraq and to export bomb-making know-how when its fighters leave the so-called caliphate and return...