Purpose. The aim of this study is to propose and test a comprehensive model of compliance with environmental law (EL). The legal and psychosocial peculiarities of environmental transgressions suggest that the nature and relative impact of the determinants of ordinary people's compliance with EL may differ from those involved in compliance with ordinary laws. Method. A total of 439 university students of Law, Psychology, Pedagogy, and Speech Therapy majors, aged between 18 and 58, took part in the study. Participants answered a questionnaire assessing illegal anti-ecological behaviour (IAEB), legal-sanction-related variables, injunctive and prescriptive social norms, personal norms, and sustainability attitudes. The data from all participants were processed using structural equation analysis to test the hypothesized model. Results. The main antecedents of IAEB are personal norms and, to a lesser extent, sustainability attitudes and descriptive social norms. Personal norms on IAEB are influenced by injunctive social norms and also by sustainability attitudes. Legal-sanction-related variables affect personal norms and IAEB, but only by indirectly influencing social norms. Conclusions. Although legal-sanction-related variables and norms have been traditionally used to explain illegal behaviour, the legal and psychosocial peculiarities of IAEB are reflected in the process of compliance with environmental protection laws. Results allow for a refinement of the relationship between personal and social norms, showing that the main determinants of IAEB is personal norm, but that descriptive social norms also directly affect behaviour, and that sustainability attitudes play an unquestionable role in compliance with ELs.