The residence was ordered to be built in the first quarter of the 15th century (likely 1420 to 1422) by Afonso, Count of Barcelos, the illegitimate son of John, and future Duke of Braganza, following his return to Portugal after a series of diplomatic missions to the Courts of France, Venice, Aragon and Castile. The construction of this building marked the concretization of his second marriage, when he took residence in the town. The project was given, as some authors have suggested, to French architect Antom. Yet, by 1442, it was still under construction when the Regent Peter came to Guimarães and stayed at the Palace, at the time conferring on his half-brother the title of 1st Duke of Braganza. The commission continued into 1461, when Afonso died: the property and titles passed on to his brother, Fernando, although the widow, Constança de Noronha, continued to live at the residence and received the land rents from the holdings in Guimarães.
In 1464, the title of Count of Guimarães is given to Fernando II, son of the Duke of Braganza, by King Afonso V (which was later renovated in 1475). Three years later, on 1 April 1478, the 2nd Duke of Branganza, died, followed two years later by the death of the widow of the 1st Duke of Braganza: the titles and vast land holdings passed on to Fernando II. During the 16th century there was a move towards monumental construction, increasing at the time the main floor over the principal gate.