Naruhito, the 53-year-old son and heir of Emperor Akihito, planted a cherry tree next to a statue where the samurai Hasekura Tsunenaga stands immortalised, sword on hip, in a bronze statue overlooking the green water of the Guadalquivir River.
Seventeenth-century Coria was a key stopping point for merchant ships from around the world heading to nearby Seville, a hub of the mighty Spanish empire.
In 1613 Hasekura led a Japanese delegation that left for Europe and arrived in Coria a year later. Some of the Japanese delegation are believed to have stayed on after he left in 1620.
"Not long after that delegation came here, this unusual surname appeared," said Vicente Valencia Japon, a local businessman who has researched the history of his town's Japanese ties. "In Spain it is a very rare name. It is unique to this place."
Authorities say around 700 people in the area bear the surname in Coria del Rio, population about 30,000.
Cheered on by crowds of local children waving Japanese flags, Naruhito, in a beige jacket, stooped to shovel in earth for the tree and smiled at a crowd that included numerous locals bearing the name "Japon" - Spanish for Japan.
"It is a very happy day for me," said Agustina Japon Barrera, 63, standing in a green and white summer dress in the park. "When I see Japanese people, I feel something special, because of the name I have, Japon, and because my parents talked to me a lot about Japan. It would be a dream to go there."
Japan's Yomiuri Shimbun newspaper reported last year that Japanese researchers were planning to carry out a genetic study of people from Coria to try to prove an ancestral link, though details of the study have yet to be formally released.
"There will be genetic tests so we will find out for sure if our ancestor was indeed one of the Japanese who came with the embassy, or whether it was maybe someone linked to them who symbolically adopted the name," said Valencia Japon.
Also among the visitors to Coria on Friday was Hasekura Tsunetaka, 66, who says he has traced his ancestry 13 generations back directly to the itinerant samurai himself.
Dressed in a black and gold samurai helmet and grey robes and with a curved samurai sword sheathed in his belt, he met with locals in the town library on the eve of the prince's visit.
"My ancestor came here 400 years ago, to try to forge friendship and diplomatic ties, as well as cultural and technological ones," he said, between handshakes and photos with Spanish well-wishers.
"Our mission now is to make this relationship stronger. This time we are marking mark 400 years of friendship between Coria and Japan. In the future perhaps my children and grandchildren will maintain this friendship."
Approaching the end of a week-long trip to Spain, Naruhito was to meet local and regional officials in Seville before heading on Saturday to the northern pilgrimage city of Santiago de Compostela -- the last stop on a week-long visit to mark four centuries of Spanish-Japanese ties.
"It is a very special feeling," to celebrate Coria's particular link with Japan, said Valencia Japon. "Symbols endure much longer than we expect."