New Delhi: The Centre on Tuesday favoured decriminalisation of gay sex in Supreme Court, contradicting its earlier stand and drawing the apex court's ire, prompting it to remark that the government must not make a "mockery" of the system.

As the proceedings began in the controversial case, Additional Solicitor General Mohan Jain told the bench that as per the government decision there is no legal error in the Delhi High Court verdict which had decriminalised gay sex in 2009.

The stand taken by Jain, who appeared for the Union Health Ministry, was contrary to the argument by Additional Solicitor General P P Malhotra, who had appeared for the Ministry of Home Affairs and had opposed decriminalisation of gay sex.

Taking a strong exception to the change in government's stand, the bench of justices G S Singhvi and S J Mukhopadhaya pulled up the Centre and asked it not to make a mockery of the system.

"Don't make (a) mockery of the system. ASG Malhotra has already argued the case for more than three hours. Don't waste the court's time," the bench said.

"We noted down arguments put forward by the Home Ministry. So now you tell the stand of your ministry," the bench told Jain.

It allowed Jain to argue on behalf of the Health Ministry in support of decriminalisation of gay sex.

The Government during previous hearing of the case on February 23, had tied itself in knots by first disapproving decriminalisation of gay sex, terming it as "highly immoral", but later taking a different line and drawing sharp criticism from the bench.

Appearing for the Union Home Ministry, ASG P P Malhotra had argued that gay sex is against social order and the Indian society cannot imitate the practices prevailing abroad.

As media reported the government's stand, the Home Ministry quickly distanced itself from the ASG's stand and came out with a separate statement amid the ongoing court proceedings, saying that it has not taken any stand on the Delhi High Court order decriminalising homosexuality.

The Home Ministry said the matter was considered by the Cabinet, which had decided that the Central government may not challenge the high court's verdict.

As soon as Malhotra ended his submissions in the court proceeding, spanning nearly three hours, another ASG Mohan Jain, told the court that he has been instructed to say that Centre is not taking any stand on the issue.

Taking strong exceptions to Jain's last-minute submissions, the bench said the government has already advanced its arguments and the court cannot take cognisance of the instructions given to him.

Malhotra had opposed the Delhi High Court's order which had in 2009 decriminalised gay sex as provided in Section 377 of the Indian Penal Code (IPC) and had ruled that the sex between two consenting adults of same sex in private would not be an offence.

Section 377 (unnatural offences) of the IPC makes gay sex a criminal offence entailing a maximum punishable of life imprisonment.