The grandeza is a ‘treatment’ which was formalised in the reign of Charles V whereby the titled nobles who were heads of the greatest Spanish families had the right on certain occasions to remain covered in the presence of the King and to be addressed by him as cousin. Originally it was conferred by the simple command ‘Cubridos’, and was restricted to eight dukes, two marquesses and four counts. By the mid-sixteenth century was accorded to the heads of twenty families, some with more than one branch.  Subsequently all Spanish dukedoms received the grandeza on creation, but where other titles were given it, this was usually done at a later date, and often long afterwards. From the time of Philip III there was also a patent of creation in each case, and from seventeenth century there were three classes. However the third class was abolished in 1866 and since 1874 there has been only one. Exceptionally it has been attached to a title lower than conde, or to a señorio, or given without a title or for life.
In Portugal, the grandeeship originated during the period of the union of crowns with Spain. In the eighteenth century it was restricted to dukes, marquesses and counts unless the subject of a special grant.