Human rights lawyers claim that Sina Dehghan, who was just 19 when he sent the messages, was tricked into signing his own death warrant after being persuaded to confess to the breach of Islamic law with the promise of release if he did so.
But after obtaining a confession, prosecutors dropped the agreement and sentenced Dehghan to death in January this year, according to the Centre for Human Rights in Iran.
The content of the messages, said to have been sent using the Line app, is unknown.
A source told CHRI: “During his interrogation, Sina was told that if he signed a confession and repented, he would be pardoned and let go.
“Unfortunately, he made a childish decision and accepted the charges. Then they sentenced him to death.”
His family was allegedly told if they kept quiet about the charges, he was more likely to go free.
Prosecutors asked that Dehghan be sentenced to death for “insulting the prophet' as well as to 16 months in prison for 'insulting the supreme leader'.
The sentence has now been upheld by the country’s Supreme Court, according to the CHRI, although a request for a judicial review has given his family hope that his life could still be spared.
His mother said in a video interview obtained by CHRI: “According to Sina's lawyer, steps have been taken for a judicial review, and with the good news we're hearing from him, God willing this case will come to end positively as soon as possible.”
Co-defendants Sahar Eliasi and Mohammad Nouri were also convicted of posting anti-Islamic material on social media.