In a dramatic final frame O'Sullivan needed a snooker when he potted the yellow.
However, he accidentally potted the green to snooker himself on the brown. He attempted to get out of it but fouled on the blue, and conceded defeat.
Joyce took the first frame but 'The Rocket' responded with the first century of the game, notching a 106.
Joyce rolled in 79 only for O'Sullivan to restore parity again at 2-2.
Another half-century from Joyce saw him take the lead yet again, but once again O'Sullivan responded, this time with an immaculate 132 break.
Joyce moved 4-3 clear courtesy of a 137 run in the seventh frame.
O'Sullivan made it 4-4 before he snookered himself and conceded the final frame.
Read the full article on eurosport.co.uk: O'Sullivan crashes out of China Open after losing to Joyce