A young Bulgarian man was sentenced to 40 months in jail by a Czech court on Tuesday over messages threatening terror attacks in Pakistan unless Islamabad freed a woman arrested with heroin in the country earlier this year.

The regional court in Plzen, west of Prague, found 21-year-old Nikolai Simeonov Ivanov guilty of sending the threats by email and text message to a television channel and news website in Pakistan.

The threats demanded the release of a Czech woman he knew, named as Tereza H, who had been arrested in January at Lahore airport.

“If Pakistan does not free within 48 hours Tereza, arrested with nine kilos of heroin, and does not let her take a plane to the Czech Republic, terrorist attacks will take place in Pakistan,” said the message, read out in court by the prosecution.

Ivanov, who has lived in Plzen since 2016, was sentenced to 40 months in prison by the court, after admitting that he had sent the messages, adding that he had not realised the consequences of the threats.

“I did not think that anyone would take my messages seriously, especially since I included my telephone number and email address,” said Ivanov, whose lawyer had asked for a suspended sentence.

The Plzen court said in its ruling that Ivanov should be expelled from the Czech Republic for eight years after his sentence is served.