Divertimento (from italian divertire - to amuse) is a music genre, with most of its examples stemming from the 18th century. The mood of the divertimento is most often lighthearted (as a result of being played at social functions) and it is generally composed for a small ensemble.
As a separate genre it appears to have no specific form, although most of the divertimenti of the 2nd half of the 18th century go either back to a dance suite approach (derived from the 'ballet' type of theatrical divertimento), or take the form of other chamber music genres of their century (as a continuation of the merely instrumental theatrical divertimento). There are many other terms which describe music similar to the divertimento, including serenade, cassation, notturno, Nachtmusik; after about 1780 the divertimento was the term most commonly applied to this light, "after-dinner" and often outdoor music. Divertimentos have from one to nine movements, and there is at least one example with thirteen. The earliest publication to use the name "divertimento" is by Carlo Grossi, in 1681, in Venice (Il divertimento de' grandi: musiche da camera, ò per servizio di tavola) --and the hint that the divertimento is to accompany "table service" applies to later ages as well, since this light music was often used to accompany banquets and other social events.
Mozart is known for having composed different types of divertimenti, sometimes even taking the form of a small symphony (or, more exactly: sinfonia), e.g. the Salzburg Symphonies KV 136-137-138. Even more unusual is his six movement string trio, KV 563, which is a serious work belonging with his string quartets and quintets, for all that it is labeled a divertimento. Other composers of divertimentos include Leopold Mozart, Carl Stamitz, Haydn and Boccherini.