The five-times World Champion got off to a fine start by taking the opening frame with a break of 57.
Scottish veteran McManus took the next frame to level, but O'Sullivan still looked good as he smashed in a break of 139 and was on a break of 54 while leading 3-2 in the sixth frame.
That break faltered of 54, however, allowing McManus in to steal and square the match once more.
And the 43-year-old then won the next two frames to send O'Sullivan home.
World number seven Shaun Murphy also had a tough match against world number 32 Joe Swail - runs of 80 and 102 saw Murphy into a 2-1 lead but a 65 levelled proceedings.
The pair exchanged frames before a 56 saw Murphy into a 4-3 advantage but Swail produced a 50 to see the match into a decider, which Murphy took courtesy of a break of 75.
Shanghai Masters results
Alan McManus 5 - 3 Ronnie O'Sullivan
Shaun Murphy 5 - 4 Joe Swail