In 1246, conflicts between his brother, the king, and the church became unbearable. In 1247, Pope Innocent IV ordered Sancho II to be removed from the throne and to be replaced by the Count of Boulogne. Afonso, of course, did not refuse the papal order and consequently marched to Portugal. Since Sancho was not a popular king the order was not hard to enforce, and he fled in exile to Toledo, Castile, where he died on 4 January 1248. Until his brother's death and his own eventual coronation, Afonso retained and used the title of "Visitador, Curador e Defensor do Reino" (Overseer, Curator and Defender of the Kingdom).