SINGAPORE (Reuters) - Singapore has dropped charges against a political cartoonist in return for an apology for publishing comic strips deemed to be in contempt of court, an offence that could have landed him in jail.

Chew Peng Ee, known to followers of his "Demon-cratic Singapore" site on Facebook as Leslie Chew, had committed contempt "by scandalizing the judiciary of the Republic of Singapore", the Attorney-General's Chambers said last month.

The charges stemmed from four cartoons Chew had published in 2011 and 2012, three of which were about the perceived unfairness of the courts when imposing punishment.

Some critics had described the charges as a sign that the long-ruling People's Action Party was becoming increasingly intolerant of opponents.

Prosperous, multi-racial Singapore, a key U.S. ally, has long taken a tough stand against criticism of the government, with leaders saying they need to protect their reputations.

But in Chew's case, the Attorney-General's Chambers had a change of heart.

"Following a request initiated by counsel for Mr. Leslie Chew, the Attorney-General's Chambers has today agreed not to pursue the contempt proceedings against him if the comic strips in question are taken down, with an apology and undertaking prominently posted on the Demon-cratic Singapore Facebook page," the AG's office said in statement that was put up on its website late on Tuesday.

There are no set penalties for contempt of court in Singapore and the judge could have issued a warning or fine instead of a jail sentence.

(Reporting by Kevin Lim; Editing by Nick Macfie)