1. This is a suit upon bond executed in favour of one Alangi Ammal, and it has been found that the consideration was future adulterous cohabitation. The consideration is obviously unlawful and therefore under Section 23 of the Indian Contract Act the agreement is void and cannot be enforced. The District Judge has however, found that because defendant has benefited by the illegal and immoral contract, inasmuch as the adulterous co-habitation has taken place, he cannot succeed in his plea and has decreed the suit. He relies on Deivanayaga Padayachi v. Muthu Reddi : (1920)39MLJ525 , but that and other similar cases can be distinguished on the ground that the Court was not asked to enforce the immoral contract, but to set it aside after the object had been carried out. So far from defendant not being allowed to raise the contention that the contract is immoral it has repeatedly been laid down that when a Court finds a contract to be immoral or illegal it should decline to enforce it, even though defendant has not raised the plea. I need only refer to the judgment of Lord Mansfield in Holman v. Johnson (1775) 1 Cowp. 341 and to a recent case North Western Salt Co., Ltd. v. Electrolytic Alkali Co. Ltd. (1914) A.C. 461. Objection is then taken that this Court cannot interfere under Section 115, Code of Civil Procedure, because no question of jurisdiction is involved. Reliance is placed on the observations of the Privy Council on the subject in Balakrishna Udayar v. Vasudeva Aiyar 33 M.L.J. 69 (P.C). Here, however, the District Judge has not only tailed to entertain the plea of illegality suo motu but has refused to allow defendant to raise it and had thus declined a jurisdiction which he undoubtedly possessed. He has clearly acted with material irregularity in the exercise of his jurisdiction within the meaning of Section 115, Code of Civil Procedure, and in support of my view I refer to Gangayya v. Venkatramayya (1922) 44 M.L.J. 80 and Sundaram v. Mausa Mavuthar I.L.R. 44 M. 554. The petition is accordingly allowed and plaintiff's suit dismissed with costs throughout.