Trump, 30, had been in imperious form heading into the third-round encounter having secured whitewashes against Mike Dunn and Yuelong Zhou in round one and two respectively.
Joe Perry seals win against world champion Judd Trump
Murphy stages brilliant comeback to win China Championship against Williams
However, Perry, a semi-finalist at the Paul Hunter Classic in August, put together runs of 89, 59 and 92 to come back to oust the reigning world champion and world number one.
Trump, already a winner at the International Championship this year, put together runs of 60 and 102 to take a 2-1 advantage but 18th seed Perry reeled off the last four frames to progress.
Murphy wins frame with crazy fluke in China
The defeat marks the 30-year-old's first loss at a ranking event in 15 matches, the last defeat coming in April when he was beaten at the China Open by Robbie Williams.
Elsewhere, third seed Mark Williams downed 14th seed Luca Brecel, while Vafaei put together runs of 81, 56 and 81 to beat Anthony McGill 5-4.
In the later session, Mark Selby enjoyed a routine 5-2 win over Chris Wakelin, while breaks of 129 and 96 helped Shaun Murphy see off Matthew Selt 5-3.
But there was to be another huge shock as John Higgins fell 5-3 to Kurt Maflin despite the Scotsman winning the first three frames.
Murphy sinks tricky red to win match in style
A 106 got Higgins off to the perfect start before a 58 and 82 put him within two frames of victory.
However, Maflin reeled off five frames in a row - which included a 103 break - to stun the four-time world champion.
Meanwhile, Barry Hawkins edged Zhao Xintong 5-4 after a 56 break saw him win the decider.
CHINA CHAMPIONSHIP ROUND THREE
- Mark Selby 5-2 Chris Wakelin
- Shaun Murphy 5-3 Matthew Selt
- Barry Hawkins 5-4 Zhao Xintong
- Kurt Maflin 5-3 John Higgins
- Hossein Vafaei 5 – 4 Anthony McGill
- David B Gilbert 5 – 2 Noppon Saengkham
- Mark J Williams 5 – 1 Luca Brecel
- Joe Perry 5 – 2 Judd Trump
Selby's final-frame 98 sinks Hawkins in decider
Share this article