The song, which includes explicit words regarding black people and women as well as references to murder, was unintentionally printed inside 1000 programmes for the Joy to the World Festival carol service in the capital, Colombo.
What worshippers were expecting to see:
Hail Mary, full of grace,
the Lord is with thee;
blessed art thou amongst women,
and blessed is the fruit of thy womb, Jesus.
Holy Mary, Mother of God,
pray for us sinners,
now and at the hour of our death. Amen.
The Catholic Archdiocese of Colombo, which organised the event at the Nelum Pokena Theatre, has apologised and said a young boy putting together the service's programme accidently downloaded the wrong words from the internet.
Hail Mary was Tupac Shakur's last single before his death at the age of 25 in September 1996 in a drive-by shooting.