Several papers published during the last decade dealt with scheduling a maintenance activity and considered a new setting, where the maintenance duration is assumed to be deteriorating, i.e., it requires more time or effort if it is delayed. We study a deteriorating maintenance in the context of due-window assignment, where a time interval is determined such that jobs completed within this interval are "ontime", whereas early and tardy jobs are penalized. Thus, our paper extends known models by considering simultaneously a deteriorating maintenance and due-window. Two deterioration types are considered: time-dependent (where the maintenance time increases as a function of its starting time), and position-dependent (where it is a function of its position in the sequence). The classical assumption of position-independent processing times was considered first, and then the model is extended to general position-dependent processing times. We prove several properties of the optimal timing of the due-window and of the maintenance. Consequently, we show that all the problems studied here are solved in 0(n(4)), where n is the number of jobs. (C) 2014 Elsevier Ltd. All rights reserved.