"on the last line of defense," 1715, attributed to William of Orange; if so, originally in a Dutch context.

We have no space to enter into the detail of the heroic struggle maintained by the young stadtholder and his faithful Dutchmen; how they laid their country under water, and successfully kept the powerful invader at bay. Once the contest seemed utterly hopeless. William was advised to compromise the matter, and yield up Holland as the conquest of Louis XIV. "No," replied he; "I mean to die in the last ditch." A speech alone sufficient to render his memory immortal. [Agnes Strickland, "Lives of the Queens of England," London, 1847]