The president and first lady were among the mourners paying their respects at St. Peter’s Basilica in Rome.