Do firms gain environmental legitimacy when they conform to external expectations regarding the natural environment? Drawing on institutional logic and signaling theory, we investigate sources of heterogeneity in the impacts of environmental actions on environmental legitimacy. Longitudinal data about 325 publicly traded U.S. firms in polluting industries support the notion that environmental actions help firms gain environmental legitimacy. However, some actions instead can harm this legitimacy if environmental performance deteriorates and the firm is subject to intense scrutiny from nongovernmental organizations. Thus, an important contribution of this research is to identify conditions under which greenwashing can backfire.