The Prince of Persia beat O’Sullivan 5-4 in the last 16 on Thursday at the Yushan Sport Centre in China.
However, the Iranian almost spurned his chances of victory during a dramatic final frame.
Vafaei looked on course to win before missing a straightforward red, which left the commentators stunned.
His error allowed the Rocket to return to the table, with O’Sullivan opening up a 26-point lead after potting the final red.
He himself then missed a black along the cushion to hand the initiative back to Vafaei, who went on to win the match.
Speaking afterwards, he told WST.tv: “I’m still shocked how I missed that red to be honest with you. I feel great, but to be honest with you, I’m still shocked how I missed that red.
“I went down so quick [on the shot] that my eyes couldn’t see anywhere. That was unforgivable.”
Revealing how emotional he was during the final frame, Vafaei continued: “I had to control myself but inside I was nearly crying, how did I miss that?
“Because I saw the red on the position on the table and all of a sudden I said, ‘That’s finished, I’ve done it’. And then all of a sudden I missed the red, I don’t know how.”
CASINO SPECIAL – BEST CASINO WELCOME OFFERS
The eventful last 16 clash had earlier been disrupted by a “xylophone” noise from the crowd.
Vafaei’s win sets up a quarter-final meeting with Ding Junhui for a place in the last four.
This week’s World Open will conclude on Sunday with the winner claiming £170,000 in prize money.