Levada was handed the subpoena minutes before he began the procession to the altar at St. Mary's Cathedral.
It requires him to give a deposition Aug. 12 concerning sex abuse allegations against priests in the Portland, Ore., archdiocese, where he was archbishop from 1986 to 1995.
The 69-year-old archbishop spoke to a standing-room-only crowd of 3,000 in the cathedral Sunday, telling them he would miss San Francisco but he looked forward to working as "God's shepherd" in Rome.
"What I have experienced in the city of Saint Francis ... has been a great grace for me," he said.
Levada is expected to leave later this month for his appointment as head of the Vatican's Congregation for the Doctrine of the Faith, the post held by former Cardinal Joseph Ratzinger before he became Pope Benedict XVI.
In that role, Levada will help shape Catholic doctrine and play a major role in the church's response to claims of sexual abuse by priests.
As Levada spoke Sunday, about 50 protesters held a silent vigil outside with signs reading: "In memory of children abused by clergy."