Afonso III (; rare English alternatives: Alphonzo or Alphonse), or Affonso (Archaic Portuguese), Alfonso or Alphonso (Portuguese-Galician) or Alphonsus (Latin), the Boulonnais (Port. o Bolonhês), King of Portugal (5 May 121016 February 1279) was the first to use the title King of Portugal and the Algarve, from 1249. He was the second son of King Afonso II of Portugal and his wife, Urraca of Castile; he succeeded his brother, King Sancho II of Portugal, who died on 4 January 1248. Early life Afonso was born in Coimbra. As the second son of King Afonso II of Portugal, he was not expected to inherit the throne, which was destined to go to his elder brother Sancho. He lived mostly in France, where he married Countess Matilda II of Boulogne in 1238, thereby becoming count of Boulogne, Mortain, Aumale and Dammartin-en-Goële jure uxoris. Reign 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, naturally, 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). In order to ascend the throne Afonso abdicated his rights to the county of Boulogne in 1248. In 1253, he divorced Matilde in order to marry Beatrice of Castile, illegitimate daughter of Alfonso X, King of Castile, and Mayor Guillén de Guzmán. Determined not to make the same mistakes as his brother, Afonso III paid special attention to what the middle class, composed of merchants and small land owners, had to say. In 1254, in the city of Leiria, he held the first session of the Cortes, a general assembly comprising the nobility, the middle class and representatives of all municipalities. He also made laws intended to restrain the upper classes from abusing the least favored part of the population. Remembered as a notable administrator, Afonso III founded several towns, granted the title of city to many others and reorganized public administration. Afonso showed extraordinary vision for the time. Progressive measures