The former world champion led 5-4 and was on the verge of wrapping up victory when he missed a simple brown.
Instead, Vafaei held his nerve to take the frame on the black and then sealed victory with a break of 61 in the decider.
That booked a semi-final meeting with Thailand's Thepchaiya Un-Nooh, the home favourite enjoying a comfortable 6-2 win over Zhang Anda.
Ding Junhui, who beat Ronnie O'Sullivan 6-2 in the afternoon session, swept aside Stuart Bingham by the same scoreline to set up a meeting with Tom Ford in the other semi-final.
Ford squandered a 5-0 lead in a thrilling match against John Higgins, who battled back to make it 5-5 before Ford's break of 67 finally got him over the line.