Gynaecology & Obstetrics

A patient at 5 months pregnancy complains of acute lower abdomen pain. On examination cervical os is closed and there is a tender right adnexal mass. On USG there is a normal intrauterine pregnancy with a 6 cm right ovarian dermoid cyst. Most probable diagnosis is?