A man who sent abusive messages to girls he believed had bullied his late sister has been spared jail by a judge, who said he had been "irrational with grief".
Jordan Clements' 14-year-old sister Nyah James was found dead at her home in Blaenymaes, Swansea, in February.
Swansea Magistrates' Court heard Clements later targeted four girls.
The 20-year-old pleaded guilty to two counts of harassment and two counts of sending offensive communications.
Clements was ordered to complete a 125-hour community order as well as 15 days of rehabilitation.
District Judge Neale Thomas said he could have sent Clements to prison because of the targeted and frightening online messages he sent to his four victims, which the court heard were abusive and threatening.
However, Judge Thomas said the defendant had become "irrational with grief" following Nyah's death.
He said: "The defendant's younger sister took her own life on 6 February.
"It is difficult if not impossible to imagine the horror and devastation of such an event.
"The defendant was under the impression that (his victims) had bullied her (Nyah)."
Judge Thomas said the sentence he passed came with a great deal of care and consideration.
While he said he did not "minimise" the effect on the teenage girls, he said that Mr Clements' mother had lost her daughter and losing her son to custody would be unthinkable.
He added he was certain the offences would not have happened were it not for the tragic death of his sister.
The court also heard that the issue of whether bullying had played a part in Nyah's decision to take her own life would be "down to the coroner".
Clements will have to pay £85 in costs and an £85 court surcharge following the case.