The U's had only lost one of their previous 12 league games and they would have gone above Tranmere if they had managed a fourth home win on the bounce.
But it was Rovers who secured the victory to move five points clear of their opponents in the League One table, thanks to a second-half winner from defender Ryan Shotton.
Stoke City loanee Shotton headed home a Charlie Barnett free-kick in the 49th minute and Rovers comfortably held onto their lead.
In fact, Shotton had come close to breaking the deadlock after just three minutes of what proved to be a very open game.
His header beat keeper Jimmy Walker, only to thud off the bar. The rebound would not fall kindly for Tranmere, allowing home skipper Dean Hammond to head back to his keeper.
Rovers actually had the best two chances of the first half. The other opportunity fell to winger Chris Shuker who dragged the shot wide of the target on 25 minutes after he had been found by Bas Savage. It was a glaring miss from Shuker.
Winger Mark Yeates went close with an early shot and he then set up Hammond, who saw his downward header well saved by Tranmere keeper Danny Coyne.
The impressive Coyne also got his fingertips to a shot from Yeates just before half-time, and his Tranmere side then took control in the second half, having a couple of goals disallowed for fouls.
The U's had appeals for a penalty turned down on 78 minutes, when the ball appeared to brush the hand of defender Andy Taylor.
Then, in the last minute of stoppage time, sub Jamie Guy was denied by a last-ditch challenge from keeper Coyne just outside the penalty area.
Rovers are now just three points adrift of the top six. By contrast, this defeat was damaging for Colchester in their own quest to make a late dash for the play-offs.