did he live in a palace?
Yes, Palace of São Cristóvão.
Afonso, Prince Imperial of Brazil
Afonso was born at 13:35 on 23 February 1845 in the Palace of São Cristóvão, in Rio de Janeiro, Brazil.
who was afonso? Prince Imperial and heir apparent to the throne of the Empire of Brazil. when was he born? 23 February 1845 who was he to successor of? Pedro II
wiki:11158128
Afonso, Prince Imperial of Brazil [SEP] Birth
Afonso was born at 13:35 on 23 February 1845 in the Palace of São Cristóvão, in Rio de Janeiro, Brazil. He was named after his ancestor Afonso, Duke of Braganza, son of King João I of Portugal and founder of the House of Braganza (Portuguese: "Bragança"). His full name was Afonso Pedro de Alcântara Cristiano Leopoldo Filipe Eugênio Miguel Gabriel Rafael Gonzaga. Through his father, Emperor Pedro II, he was a member of the Brazilian branch of the House of Braganza (Portuguese: "Bragança") and was referred to using the honorific "Dom" (Lord) from birth. Afonso was the grandson of Emperor Pedro I of Brazil and nephew of Queen Maria II of Portugal.