Anxiety related to untreated sleep apnea??

Has anyone had bad anxiety or panic attacks that got better after starting treatment (cpap)

I’ve had anxiety for a while now.. my doctor thinks maybe my sleep apnea is causing my symptoms. So I’m wondering if anyone else has dealt with this