The dean of the university’s medical school made the surprise announcement Monday to about 30 grateful undergrads.