IT is an extradition battle that thrust Scotland into the middle of a legal maze linking an alleged multi-million dollar mortgage scam, a convicted sex attacker wanted by the FBI, and Pakistan's deepest religious divide.

But now Scots prisoner and "Jewish convert", Johar Javed Mirza, looks set to face justice in the US after Edinburgh Sheriff Court rejected his plea that he would be "at mortal risk" if deported back to his Pakistani homeland.

Mirza, also known as Jacob, is a Pakistani national currently serving a three-year jail term in Saughton Prison for attempting to rape a student in the west end of Glasgow in 2010. He was convicted in 2014 and is scheduled for release no earlier than May this year.

However, the 35-year-old, who is appealing his conviction to the UK Supreme Court, is also wanted by the FBI and was the subject of an Interpol Red Notice, meaning any country finding him should alert the USA. That order was in connection with an alleged mortgage scam which is said to have netted himself and his alleged co-conspirators, including his brother, $2.7 million (£1.9m) between 2005 and 2008. Mirza, who was then working as an estate agent, mortgage broker and financial advisor in the state of Virginia, faces nine charges of serious fraud.

The charges relate to the allegation that Mirza enlisted a number of people to apply for mortgages they never intended to pay. Mirza is said to have provided false bank account details for the applicants and set up at least five bogus companies which claimed to employ them in order to obtain the loans. As broker, this helped Mirza net commission on the deals. However, the fake buyers then defaulted on the mortgages, leaving the lenders out of pocket. It is claimed the money earned from the dodgy deals was divided between the gang.

His brother, Gohar Mirza, also a Jewish convert, has already plead guilty and was sentenced to five years in prison in the US.

The long-running court battle against his extradition unravelled at Edinburgh Sheriff Court where a Sheriff threw out Mirza's claim that his human rights would be jeopardised if he were returned to the US.

The case, which hinged on Mirza's status as a converted Jew – a claim disputed by the Crown – has now be referred back to Scottish ministers to sign off the extradition, with a final decision required by March – or within two months of Mirza's release, if deferred.

During the hearing, Mirza – who was born in Pakistan but emigrated to the US aged four – claimed that as a Muslim who had converted to Judaism he would be persecuted and probably killed if the US authorities deported him back to Pakistan after legal proceedings in America against him were completed.

He told how his family had turned against him after he changed faiths and that it was a social taboo in his homeland.

The judgement by Sheriff Thomas Welsh QC states: "Mr Mirza recounted how he could not, as a Jewish convert, feel safe in Pakistan, if he were to be sent there after any proceedings in the USA, consequent upon extradition. He said he would be at mortal risk in Pakistan.

"He indicated he had been taught as a child that Jews and Christians were 'the enemy'. His conversion to Judaism is widely known on his father's side of the family and he would be at real risk of death from relations and others, if he returned to Pakistan."

The court heard that Mirza had rejected Islam after being "repeatedly sexually abused" as a child by the Imam at a mosque in Lahore, and that as a teenager in the US he had become attracted to Judaism – though he also had "bouts of being atheist and agnostic".

In 2005, he began dating a Jewish woman, Anya Shifrina. The relationship lasted two years but she was never accepted by Mirza's family, and in 2008 he was "pressurised" to wed his Muslim wife and UK national, Sasha Umarr, in Pakistan. In 2010, the couple settled in Glasgow, and it was while living in Scotland that Mirza paid a Rabbi £3,000 to officially convert.

The Crown claimed the marriage was a "sham device" to secure Mirza a UK visa and that his claimed conversion to Judaism was "a complete fabrication, invented for no other reason than to dupe the court and avoid lawful extradition".

Mirza was also accused of lying in 2014 to his then-employer, Harper Macleod Solicitors, by claiming he was "abroad" when he was in fact on trial for attempted rape.

The court also heard that Mirza had been the subject of a proceeds of crime probe, subsequently abandoned by Scottish ministers, and that he had been warned by police for kerb-crawling in July 2010 – less than two weeks before he was charged with sexual assault.

Sheriff John Beckett QC, who presided over Mirza's conviction, described the attack as a "particularly sinister example of this type of crime". Mirza had stalked his 21-year-old victim in his car from a takeaway, before dragging her to the ground and punching her.

Concluding the extradition case on January 12, Sheriff Welsh stated that he was "not presiding over a medieval auto-da-fé" and ruled that Mirza's religion was neither "relevant or material".

He said: "Whether the respondent is Muslim or Jew he can only be extradited if extradition would be compatible with his Convention rights," adding that Mirza's lawyers had "offered not the smell of a petrol rag of evidence" that their client's human rights would be violated.

The Sheriff concluded that the US "does not operate a mandatory policy of return of criminal aliens to their country of origin", describing the legal reality as "more complex".

In any case, said Welsh, if extradited, Mirza "will have guaranteed legal representation and the protection of US constitutional rights including the right to silence, the right against self-incrimination and the right to a fair trial before an independent judge with the right to appeal".

Legal representatives for Mirza declined to comment. A spokeswoman for the Scottish Government said: "We cannot comment on individual cases."