Federal health regulators announced on Tuesday that they would require manufacturers of sleeping pills such as Ambien and related drugs to post strongly worded warnings in boxes on labels and patient guides. The Food and Drug Administration, in what it called a safety announcement, noted that the drugs’ side effects included risky behaviors, such as sleepwalking and sleep driving, that can lead to injury and even death.

The F.D.A. singled out Ambien and two other popular sleep aids, Lunesta and Sonata, as well as three formulations of zolpidem, the generic name for Ambien. The boxed warnings — the most prominent form of warning required by the agency — must list side effects such as sleepwalking and sleep driving, in which people using the drugs take risks without being fully awake.

The agency said such reactions were rare but could lead to injuries or death; it advised doctors not to prescribe the drugs to people who have had such side effects in the past.

“Patients, stop taking your insomnia medicine and contact your health care professional right away if you experience a complex sleep behavior where you engage in activities while you are not fully awake,” the agency’s safety alert said, “or if you do not remember activities you have done while taking the medicine.”