Nagasaki Castella is said to have been first introduced officially to Japan in 1592, when Touan (等安) Murayama of Nagasaki learned the recipe from a Castilian traveler of a European ship visiting Nagasaki and presented it to Regent Hideyoshi Toyotomi.
Delighted by the Western delicacy, Hideyoshi named Touan the first magistrate of Nagasaki.
Initially, people of Nagasaki called the sweet “Castella Touan (等安)”, but legend has it that the Chinese characters meaning “sugar hut (糖庵)” were later applied to the sound “Touan” in “Nagasaki Castella Touan” because of the generous use of white sugar, which was not easily available in the olden days.
– From “Fun Facts about Nagasaki Sweets” by Tetsuya Etchu –