A Quincy man tried to sell a bike on Craigslist. But it was stolen and the buyer was an undercover cop, police say.

Bret Martinson, 31, was arrested Tuesday at the MBTA's Andrew Square Station.

Bret Martinson.

A Craigslist posting led MBTA Transit Police to a stolen bicycle on Tuesday, according to a release.

A commuter’s bicycle had been stolen from the MBTA’s Quincy Center Station on Nov. 13, and, shortly after, was posted for purchase on Craigslist, according to police.

“Transit Police detectives contacted the poster and made arrangements to ‘Buy’ the bicycle,” police said.

Around noon Tuesday, an undercover detective met with a man, later identified as 31-year-old Bret Martinson, of Quincy, who brought the bike to Andrew Square Station, according to the release. Once the bicycle was determined to be the one stolen, Martinson was arrested and charged with receiving stolen property, police said.