Masterpiece (or chef d'œuvre) in modern usage refers to a creation that has been given much critical praise, especially one that is considered the greatest work of a person's career or to a work of outstanding creativity, skill or workmanship.
Originally, the term masterpiece referred to a piece of work produced by an apprentice or journeyman aspiring to become a master craftsman in the old European guild system. His fitness to qualify for guild membership was judged partially by the Masterpiece, and if he was successful, it was retained by the guild. Great care was therefore taken to produce a fine piece in whatever the craft was, whether confectionery, painting, goldsmithing, knifemaking, or many other trades. The Royal Academy in London is one institution that has acquired a fine collection of "Diploma works" as a condition of acceptance.
It probably derives from the Dutch "meesterstuk" (German: Meisterstück), and the form "masterstik" is recorded in English in 1579 (or in Scots, since this was from some Aberdeen guild regulations), whereas "masterpiece" is first found in 1605, already outside a guild context, in a Ben Jonson play.