The Supreme Court on Wednesday stayed the arrest of a man accused of rape after being informed that he and the complainant have agreed to get married, Bar and Bench reported.

The man, who is from Punjab, had met the woman while she was studying in Australia in 2016. The woman said in her police complaint that the man had been persuading her to have sexual relations with him and had promised to marry her.

The complainant said she told the man that they cannot get married since they belong to different castes. However, the man had told her that their castes would not be a problem. The woman added that she refused to be intimate with him. She alleged that on one occasion, the man had put drugs in her food and sexually assaulted her. The complainant also said that the man had taken pictures of her.

The woman said that they had sexual relations after returning to India as the man had promised to marry her. She claimed that he backtracked later, saying that his family would not approve of his marriage to a woman belonging to a Scheduled Caste. A rape case was filed against him after this.

However, during the Supreme Court hearing on Wednesday, the man’s lawyer told the court that the two had reached a compromise.

The bench headed by Chief Justice of India, SA Bobde said: “The parties have entered into a compromise signed by the couple and confirmed by the parents of accused; and further since the compromise states that the petitioner and the complainant will get married, we are inclined to grant ad interim stay of arrest of the present petitioner.”

The man had approached the Supreme Court after being denied bail by the Punjab and Haryana High Court in November. “Considering the serious allegations against the petitioner of committing rape on the victim on the pretext of performing marriage and then, extending threats of making the photographs viral which are in possession of the petitioner, the custodial interrogation of the petitioner is required,” the High Court had said, according to Bar and Bench.