The principle of the legality of crime and punishment (nullum crimen sine lege -nulla poena sine lege) is recognized in the Constitution of the Islamic Republic of Iran. However, according to Principle 167 of the Constitution, the judge, when faced with lacunae in the law, is obliged to refer to Islamic sources or authoritative juristic opinions. The main question here is that considering Principle 36 and other relevant principles of the Constitution, whether Principle 167 extends to criminal cases or is limited to civil ones. Four opinions are proposed in this regard. According to the first, Principle 167 is only limited to civil cases, since Principle 36 is an exception to Principle 167. The second is that, Principle 167 extends to criminal cases, but covers only procedural and not substantive criminal laws. The third opinion holds that the principle is applicable to identifying criminal facts only and not criminalizing and laying down punishments. And according to the fourth opinion, Principle 167 applies to both civil and criminal proceeding and the judge may criminalize some acts. The paper examines these opinions in a critical manner.