A judge in Hawaii has ordered a man to pay his ex-girlfriend 144 compliments after bombarding her with “nasty” text messages.

Judge Rhonda Loo handed out the unconventional punishment to Daren Young after he violated a court order not to contact the woman.

“For every nasty thing you said about her, you’re going to say a nice thing. No repeating words,” Judge Loo told him.

The 30-year-old had attempted to call and text his ex-partner 144 times over a three-hour period on May 22, the Maui News reports.

By trying to contact the woman, Mr Young had violated a protection order issued in February after they had split up, the court heard.