The prayer service, known as a penitential rite and required by Canon law, was led by the basilica’s archpriest, Cardinal Mauro Gambetti.
The Polish man stripped off his clothes and stood on the altar as the basilica was closing on Thursday.
He had an inscription painted on his back reading: “Save children of Ukraine”.
Vatican guards handed him over to Italian police, who detained him and then ordered him expelled from Italy.
At the prayer service, in which the altar used by Pope Francis was blessed with holy water, Gambetti said the man had committed a sinful and “inappropriate, truly regrettable gesture” to bring attention to the victims of war.
A Vatican source said at the time of the incident that the man also had self-inflicted cuts on his body from his fingernails.
He was not identified, but from pictures taken by tourists and posted on social media, he appeared to be in his late 20s or early 30s.
AAP