Abstract. We consider minimizing the maximum earliness in the single-machine scheduling problem with exible maintenance. In this problem, preemptive operations are not allowed, the machine should be shut down to perform maintenance, tool changing or resetting takes a constant time, and the time window inside which maintenance should be performed is prede ned. We show that the problem is NP-hard. Afterward, we propose some dominance properties and an e cient heuristic method to solve the problem. Also, we propose a branch-and-bound algorithm, in which our heuristic method, the lower bound, and the dominance properties are incorporated. The algorithm is computationally examined using 3,840 instances up to 14,000 jobs. The results impressively show that the proposed heuristic algorithm obtains the optimal solution in about 99.5% of the cases using an ordinary processor in a matter of seconds at most.