WALTHAM, Mass. — African rhythms echoed through the chambers of St. Mary Parish on Sunday, just as they did nearly 50 years ago at the Vatican.

That was the day thousands gathered for the canonization of a martyred Ugandan saint and his 21 Catholic companions. On Sunday, people congregated in Waltham to honor that moment.

Hearing the drums on Sunday, Aloysius Lugira said memories of St. Peter’s Basilica from nearly half a century ago came rushing back. He remembered the sea of faces — African, Asian, and European — transfixed by the sounds of African drumbeats pouring, for the first time, from the most sacred Catholic site in the world.

Eighty-two-year-old Lugira served as head drummer for the ceremony.

“This was an occasion at which the world experienced African music becoming the pride of St. Peter’s Basilica,” he said. “I mean, the audience, they were stretching their necks to see what was going on.”

Bishop John Baptist Kaggwa, from the Malaka Diocese of Uganda, served as the main celebrant during Sunday’s celebration of the 50th anniversary of Pope Paul VI’s canonization of St. Charles Lwanga and his companions.

“I bring you all greetings from your brothers and sisters in Uganda,” he said to applause. “They all love you, and they wish you a happy celebration today.”

Wearing long robes and bright traditional Ugandan dresses with pointed shoulders, parishioners sang, danced, and offered prayers honoring the men known as the Uganda Martyrs. The worshipers were led by a traveling choir that honors the men, singing from the gallery overhead.

St. Lwanga and his companions were killed at a time of religious persecution in the former kingdom of Buganda. Present-day Ugandans regard St. Lwanga as the leader of Catholic activity in Africa. Catholics constitute a plurality — about 40 percent — of the Ugandan population today, according to the most recent census data.

“To us, they are the foundation of the church in Uganda,” Kaggwa said in an interview after the two-hour service, which was attended by about 200 people.

Ruler Mwanga II sent scores of Catholics and Anglican converts to their deaths between 1885 and 1887 in an effort to resist colonization, seeing the loss of traditional African religion as a threat to his power, Kaggwa said.

In 1886, the ruler demanded a group of converts reveal their loyalty — either to him or their faith — in court. Upon realizing their allegiance to Lwanga and Christianity, he condemned the young converts, all under 35, to death.

Many, including the man who would become a saint, were burned alive on June 3, 1886.

Ugandans now mark that day with celebrations. Thousands visit the Basilica to honor the Uganda Martyrs every year around that time, traveling sometimes for weeks by foot to visit the holy site of the burnings. They share in a feast once there.

“It’s a pilgrimage, really,” said Lorna DesRoses, director of Boston’s Black Catholic Ministries.

DesRoses said celebrations like Sunday’s allow Greater Boston’s large Ugandan community to unite. Worshipers traveled from as far as Virginia and New York on Sunday.

“For the Ugandan community it is an important celebration because this is a way to celebrate their community, their continuing faith here,” she said. “The beauty of it is, yes, people are here in Boston from Uganda, but they’re able to still keep this tradition and culture alive.”

In English, Swahili, and Latin, choir members and churchgoers sang songs honoring the martyrs on Sunday.

“The fire of Namugongo quenched them,” they sang in Swahili. “It burnt their bodes. It cleansed their souls.”

The Uganda Martyrs were beatified collectively under Pope Benedict CX in 1920. Pope Paul VI canonized them on Oct. 18, 1964, at the ceremony attended by Lugira.

Lugira later escaped Uganda after it was revealed he had committed actions disloyal to President Idi Amin.

On Sunday, he remembered looking around almost in disbelief 50 years ago as he struck melodies on the Bakisimba drum.

A ceremony taking place at the Vatican, honoring people like him and his fellow countrymen, was a sight to see, he said.

“The church was full,” he recalled. “This happening was extraordinary. Black Africans to be canonized into sainthood. It was a grand occasion.”