The Oscar-winning actress spoke Monday at the University of Pennsylvania's commencement ceremonies, ending her address with the chorus of Eminem's "Lose Yourself" from "8 Mile," the semi-autobiographical 2002 film in which he starred.
Foster, who graduated from Ivy League rival Yale University in 1985, received an honorary doctor of arts degree.
She earned laughs from the graduates by taking pictures of them from the podium and then by recalling her own years at Yale. But she struck a serious note later, saying the country and world are worse off than they were four years ago, and challenging graduates to change that.
The United States "squandered" the goodwill and sympathy other nations offered after the Sept. 11 terror attacks, Foster said. She also criticized officials for the "disastrous and shameful" handling of Hurricane Katrina.
Penn seniors had expressed skepticism and seemed underwhelmed by her selection as commencement speaker when it was announced earlier this year, but she received a standing ovation after her speech.
Foster, 43, won Oscars for 1988's "The Accused" and 1991's "The Silence of the Lambs." She received nominations for her roles in 1976's "Taxi Driver" and 1994's "Nell."
Aimee Masters, 22, who received her bachelor's degree in sociology and women's studies, said Foster was "really inspiring."
"Everyone around me was really happy with what she said," Masters said, adding that quoting Eminem "was surprising, but I liked it."
Comedian Yakov Smirnoff, who earned a master's degree in positive psychology, was among the approximately 6,000 graduates.
By Kathy Matheson