Origin of "gag order"

Does anyone know where this phrase came from? I thought it would be a cool name for a rock band.

To “gag” someone can mean to put something in or around their mouth so they can’t speak. A gag order is a court order enjoining someone (saying they’re not allowed to) talk about the case or some aspect of it.

gag, meaning to "stop up(a person’s mouth) to prevent speech or outcry, is first recorded in 1590. From my Chambers.

gag rule is first recorded in 1810, and referred to “legislative debate.” I believe “gag order” would be about the same time-frame.