1570s, "soft, wet, boggy land; a marsh," from obsolete quag "bog, marsh" + mire (n.). Early spellings or related forms include quamyre (1550s), quabmire (1590s), quadmire (c. 1600), quavemire (1520s), qualmire.
The extended sense of "difficult situation, inescapable bad position" is recorded by 1766; but this seems to have been not in common use in much of 19c. (absent in "Century Dictionary," 1897, which does, however, have a verb, marked "rare," meaning "to entangle or sink in or as in a quagmire"). It revived in a narrower sense in American English in reference to stalled military actions, 1965, with reference to the U.S. war in Vietnam (popularized in the book title "The Making of a Quagmire" by David Halberstam).
"wet, soft, spongy ground with soil chiefly composed of decaying vegetable matter," c. 1500, from Gaelic and Irish bogach "bog," from adjective bog "soft, moist," from Proto-Celtic *buggo- "flexible," from PIE root *bheug- "to bend." Bog-trotter applied to the wild Irish from 1670s.
A bog is characterized by vegetation, decayed and decaying, and a treacherous softness. A quagmire or quag is the worst kind of bog or slough; it has depths of mud, and perhaps a shaking surface. A slough is a place of deep mud and perhaps water, but generally no vegetation. [Century Dictionary]
"withering, liable to decay, ephemeral," 1727, from Latin marcescentem (nominative marcescens), present participle of marcescere "to wither, languish, droop, decay, pine away," inchoative of marcere "to wither, droop, be faint," from Proto-Italic *mark-e-, from PIE root *merk- "to decay" (source also of Sanskrit marka- "destruction, death;" Avestan mareka- "ruin;" Lithuanian mirkti "become weak," merkti "to soak;" Ukrainian dialect morokva "quagmire, swamp," Middle High German meren "dip bread into water or wine," perhaps also Middle Irish mraich, Welsh brag "a sprouting out; malt").