Each of the posts indicate they have not changed at all. They have not taken on board anything or learned any responsibility

The defendants, from Accrington, Lancashire, were recalled for a sentence review when the remarks were brought to the attention of the judge after she previously heard their expressions of remorse for offending.

Today, Judge Lunt said: “The question I have to ask myself is this, if I had known their real feelings at being in court would I have accepted their remorse and contrition, and suspended the sentence. And the answer is of course not.

“Each of the posts indicate they have not changed at all. They have not taken on board anything or learned any responsibility.”

The Sleddens originally received a two-year jail term, suspended for two years, after they admitted being concerned in the supply of cannabis between May and September 2014.

Both will now serve two years after the suspension was lifted by Judge Lunt.

Sitting at Preston Crown Court, Judge Lunt said the posts contained “offensive and sexual content directed at me as a judge, and also as a woman judge”.

She said: “These were not private entries in a diary. They were placed on Facebook with the intention that others should and would read them, and if they wished, would share them. So it was a limitless audience.

“Their content is clearly indicative of how they really felt about appearing in court for this particular offence. Their tenor was boastful and jeering and the only reasonable inference was, they thought they had somehow fooled and misled the court.”

Daniel Sledden’s online post was later deleted but only because he had been advised to do so by his solicitors, said the judge.

She said: “Neither defendant had thought there was anything regrettable in them or decided to delete them themselves.”

Both brothers had since written letters of apology to the judge, the court heard.

Judge Lunt continued: “These are two grown men. They are not children showing off. They both knew exactly what they were doing. They did not care who saw what they had written.

“Now I have no doubt that they are sorry they were caught.”

She said Daniel Sledden’s pre-sentence report had referred to his regret at being involved in the offence and him blaming links with his own family.

His barrister told his sentencing hearing that his client had taken “positive steps” by gaining employment.

Samuel Sledden was also said in his pre-sentence report to have been remorseful for his actions and felt “stupid” for committing the offence.

He too had since found work and had returned to college, the court heard.

Judge Lunt said such expressions of remorse are “vital criteria” when taking into account the appropriate sentence for a defendant.

She said she had based her original sentence on the delay in the case being sentenced, and their lack of offending since, together with their guilty pleas and their apparent contrition.

But the terms of the suspension were now revoked following her review.

Both brothers had been remanded in custody 10 days ago while the transcript of the mitigation and sentencing remarks was obtained.

But Judge Lunt made it clear she knew “precisely” what she was thinking when sentencing and the matters she had taken into account.

Daniel Prowse, defending Samuel Sledden, said the online comments were “ill-conceived, extremely disrespectful and displayed rude ingratitude” but neither demonstrated explicitly they were not sorry to have committed the offence.

He added that remorse was not advanced in their mitigation and in that sense neither had “conned the court”, he said.

Mr Prowse said the comments were made when both were “sufficiently emotionally affected” in the immediate aftermath of escaping an immediate custodial sentence.

He said the remarks made were also “nonsensical” as the court had “just done them a favour in not sending them to prison”.

Mr Prowse said the posts were not intended to be seen beyond their family and friends.

Arguing that it was not necessary to revoke the suspended jail terms, he said the subsequent reporting of the case had led to them becoming “national, if not international, figures of ridicule”.