David Livey, 27, from Edinburgh, spotted an ad for his £500 racer online, just days after it was nicked from outside a swimming pool in the Edinburgh.
The amateur sleuth then arranged to meet the seller for a test ride, before he pedalled up to a nearby police officer and reported the crime.
David, who works as a political researcher, said yesterday: "The guy said he wanted to get rid of it quickly - I guess he did.
"It's quite a distinctive bike and I knew it was mine. He offered me to have a wee go on it. I cycled down the street, stopped at the policeman and that was that.
"The guy was then caught red-handed. Everything worked out perfectly. It was like being in a sitcom."
David left his friends to distract the brazen salesman, who had advertised the bike on Gumtree, while he cycled up to the beat officer.
Once he got his prized Specialized Allez back, David took to social media and posted a picture of himself holding the bike with a big grin. He wrote: "Reunited with my bike! Saw it on Gumtree. Chap met me to sell it. He let me try it...so I cycled up to a policeman."
The post has since been favourited and retweeted more than 1,000 times
Police confirmed that a man had been charged with handling stolen goods, but it is not clear whether he actually stole the bike.
A spokesman for Police Scotland said: "Police can confirm that a 26-year-old man has been charged with reset [handling stolen goods] following an incident on Holyrood Road on Wednesday. A report will be sent to the Procurator Fiscal."