Midazolam, marketed under the trade name Versed, among others, is a medication used for anesthesia, procedural sedation, trouble sleeping, and severe agitation. It works by inducing sleepiness, decreasing anxiety, and causing a loss of ability to create new memories. It is also useful for the treatment of seizures. Midazolam can be given by mouth, intravenously, by injection into a muscle, sprayed into the nose, or in the cheek. When given intravenously, it typically begins working within five minutes; when injected into a muscle, it can take fifteen minutes to begin working. Effects last for between one and six hours.