The 78-year-old pontiff was greeted by wild cheers and singing at a shrine to the martyrs at Namugongo, just outside the capital Kampala, that honours more than 40 Christians who were executed in the 19th century for refusing to recant their faith.
"Pope Francis we love you!", young Christians chanted at a youth rally at the Kololo grounds in Kampala, as thousands danced to pumping music, cheering as the pontiff leaned out of the popemobile to kiss babies.
A total of 45 Catholics and Protestants, many of them youngsters working as royal pages, were executed by King Mwanga of Buganda -- a 19th century kingdom that was located in the south of present-day Uganda -- between 1885 and 1887.
At issue was their refusal to comply with the king's sexual advances towards them and other young boys in the court.
More From This Section
"Not only were their lives threatened but so too were the lives of the younger boys under their care," he said. "They were fearless in bringing Christ to others, even at the cost of their lives."
Catholic faithful from neighbouring war-torn South Sudan were also among the worshippers, having travelled 12 hours by bus to catch a glimpse of the Argentine pope, who has made humility and help for the poor a hallmark of his tenure.
"The challenges we have in Uganda are early pregnancies, drug abuse and homosexuality," said 18-year old schoolgirl Joyce Adong, dressed in her uniform and carrying rosary beads.
Homosexuality remains illegal in many countries in Africa, including Kenya and Uganda, where lawmakers passed tough anti-homosexuality legislation in 2013 that was later overturned on a technicality.
Ugandan gay rights activists had asked to meet the pope, who has said gay people should not be marginalised, but it was not clear if the meeting took place.