Illegal cycling charges against Alec Baldwin will be dismissed if the actor stays out of trouble.

The 30 Rock star was served with a summons in May (14) after New York police caught him cycling north, against the flow of traffic, along Manhattan's Fifth Avenue.

He was also cited for disorderly conduct after allegedly chastising officers for demanding to see identification he didn't have in his possession.

Baldwin appeared before a judge on Thursday morning (24Jul14) to answer the count, but refused to offer up an apology to the two female cops who confronted him in May and instead told the court, "I’d rather pay the fine".

However, Judge John Delury decided instead on an adjournment in contemplation of dismissal, giving the actor the chance to have the incident wiped off his record if he remains on his best behaviour for the next six months.

During the brief hearing, the judge asked Baldwin, "Can you stay out of trouble, Alexander?", to which he replied, "Sure, sure", prompting Delury to bid farewell by saying, "Be a good boy from now on. Have a good day."

The star had previously blasted police department officials for cracking down on cycling misdemeanours, taking to his blog and writing, "New York City is a mismanaged carnival of stupidity that is desperate for revenue and anxious to criminalize behavior once thought benign."