MANILA, Philippines — Three church bells seized by American troops as war trophies more than a century ago were returned to the Philippines on Tuesday.

U.S. defense officials and the American ambassador handed back the Bells of Balangiga to the Philippine defense chief in a solemn ceremony at an air force base in the capital, closing a dark episode in the treaty allies' love-hate relationship.

"It is my great honor to be here at this closing of a painful chapter in our history," U.S. Ambassador Sung Kim said. "Our relationship has withstood the tests of history and flourishes today."

Defense Secretary James Mattis has said the handover is an important gesture of friendship and is in the U.S. national security interest. Some U.S. veterans and officials had opposed the return of the bells, calling them memorials to American war dead.

Philippine military personnel unload the three church bells on Tuesday. Bullit Marquez / AP

The bells are revered by Filipinos as symbols of national pride, and their arrival on a U.S. military transport plane and the handover ceremony were shown live on national TV. Two of the bells had been displayed for decades at F.E. Warren Air Force Base in Cheyenne, Wyoming, and the third was with the U.S. Army in South Korea.

After being colonized by Spain for more than three centuries, the Philippines became a U.S. possession in 1898 in a new colonial era that began with the outbreak of the Philippine-American War.

American occupation troops took the bells from a Catholic church following an attack by machete-wielding Filipino villagers, who killed 48 U.S. soldiers in the town of Balangiga on central Samar island in 1901 in one of the U.S. Army's worst single-battle losses of that era.

One of the bells had been sounded to signal the attack by the villagers, some of whom were disguised as women who hid in the church near an American garrison, historian Rolando Borrinaga said.

The Americans retaliated, reportedly killing thousands of villagers above the age of 10, and a U.S. general, Jacob Smith, ordered Samar to be turned into a "howling wilderness," Borrinaga said.

President Rodrigo Duterte, who has had an antagonistic attitude toward the U.S. and has revitalized ties with China and Russia, asked Washington in his state of the nation address last year to "return them to us, this is painful for us."

"Give us back those Balangiga bells. ... They are part of our national heritage," Duterte said in the speech, attended by the U.S. ambassador and other diplomats.

Philippine Defense Secretary Delfin Lorenzana said with the resolution of the issue, "It's time for healing, it is time for closure, it is time to look ahead as two nations should with a shared history as allies."

Duterte has referred to violence by Americans in Balangiga and on southern Jolo island in the early 1900s in public criticism of the U.S. government after it raised concerns about his brutal crackdown on illegal drugs in which thousands have died.