PurposeThis research unpacks the relationship between employees' perceptions of organizational injustice and their counterproductive work behaviour, by detailing a mediating role of organizational identification and a moderating role of discretionary human resource (HR) practices.Design/methodology/approachThe hypotheses were tested with a sample of employees in Pakistan, collected over three, time-lagged waves.FindingsAn important reason that beliefs about unfair organizational treatment lead to enhanced counterproductive work behaviour is that employees identify less strongly with their employing organization. This mediating role of organizational identification is less salient, however, to the extent that employees can draw from high-quality, discretionary HR practices that promote their professional development and growth.Practical implicationsFor management practitioners, this study pinpoints a key mechanism – the extent to which employees personally identify with their employer – by which beliefs about organizational favouritism can escalate into purposeful efforts to inflict harm on the organization and its members. It also reveals how this risk can be subdued by discretionary practices that actively support employees' careers.Originality/valueThis study adds to previous research by detailing why and when employees' frustrations about favouritism-based organizational decision making may backfire and elicit deviant responses that likely compromise their own organizational standing.