Can anxiety medication cause nightmares?

It depends. It depends what kind of medication you are taking. Seroquel (quetiapine) is sometimes used to treat anxiety and it is known to cause bizarre dreams and nightmares. Talk to your doctor about what you are experiencing and have your medications evaluated. Some nightmares might be due to anxiety and more medication might be needed instead of less. More information is needed to make the right decision.
Rarely. This is an unusual response to an anxiety medication. So it makes sense to consider other possible causes. If something is causing anxiety, that could lead to nightmares. Or any other medication change?

Related Questions

Can weaning off anxiety medication cause nightmares?

Yes. This is called "rem rebound". Dreaming mostly happens during rem (rapid eye movement) sleep, and rem is suppressed by many anxiety medications. Weaning off such meds results in a temporary over-activity of rem, sometimes causing nightmares, or at least more memorable, vivid dreams. It usually doesn't last long, and is harmless aside from being disturbing & interrupting sleep. Read more...