A gastald (Latin gastaldus or castaldus, Italian gastaldo or guastaldo) was a Lombard official in charge of some portion of the royal demesne (a gastaldate, gastaldia or castaldia) with civil, martial, and judicial powers. By the Edictum Rothari of 643, the gastalds were given the civil authority in the cities and the reeves the like authority in the countryside. Under the Lombard dominion, territories were delimited by giudicati or "judgments" among the several gastalds. From the immediate region of Parma and of Piacenza, numerous such giudicati survive, which cover the range of Lombard rule. The documents follow the same formalized structure, of which one between the gastald Daghiberto and the gastald Immo was adjudged by Adaloald, at Ticino, November 615.
As paid officials with direct allegiance to the roving Lombard kings, whose seat was nominally at Pavia, the gastalds were often in conflict with the dukes, the great Lombard territorial magnates who pursued policies of autonomy. By the 9th century, the powers of the gastalds had devolved to largely administrative ones. The title gradually disappeared over the final century of Lombard power, surviving only in a few instances, especially in the Mezzogiorno, where ducal Lombard power continued for another two hundred years, for example at Capua, which was included in the Lombard Duchy of Benevento and where the count's title remained gastald as late as the 9th century, when Landulf began strenuously to establish his independence. When Benevento was divided in 851, following a decade of civil war, it was done by divying up the gastaldates, sixteen to the new Principality of Salerno, sixteen to remain with Benevento and one (Acerenza) to be divided between them.
In Milan, the institution of gastaldi endured within the cathedral chapter until the close of the Middle Ages. In the Arsenal of Venice, the gastaldi endured to the arrival of Napoleon, in the form of confraternities of craftsmen in the shipyards; the sign of the carpenters' guild, painted under the direction of Misier Zacharia d'Antonio in 1517 and renewed in 1753, under the gastaldia of Francesco Zanotto gastaldo and company, is in the Museum of Venetian History, Venice.
In Old High German, gastaldus came to denote a steward. Castaldy appears in Middle English with an abstract meaning of "stewardship"; the specific function, however, remained foreign to Anglo-Saxon or Norman institutions.