The painting was commissioned around 1639 by Captain Banninck Cocq and seventeen members of his "Kloveniers" (civic militia guards). Eighteen names appear on a shield, painted circa 1715, in the center-right background, as the hired drummer was added to the painting for free. A total of 34 characters appear in the painting. Rembrandt was paid 1,600 guilders for the painting (each person paid one hundred), a large sum at the time. This was one of a series of seven similar paintings of the militiamen () commissioned during that time from various artists.