Featured Application The model presented in this paper can be applied in production systems composed of unreliable machines subject to deterioration whose production rates can be controlled. Examples include the systems found in important industries including: Automotive, aircraft, machine tools, semiconductor, and electronics manufacturing. Therefore, given the trade-offs related with deterioration and the strong interactions between the important functions of production planning, quality, and maintenance, advanced engineering scheduling methods such as the model presented in this paper are required to keep industries profitable. We study the optimal production planning and major maintenance scheduling for an unreliable manufacturing system. We assume that the production unit experiences progressive deterioration that negatively influences product quality. For the production policy, we extend improve traditional threshold policies with a superior alternative, based on a just-in-time (JIT) strategy. The paper brings a new vision on the importance of implementing more effective production strategies based on JIT methods, instead of traditional threshold policies. When a failure occurs, the production unit is minimally repaired, and when the major maintenance is selected, the machine is restored to brand-new conditions. The objective of the model is to determine the simultaneous JIT production and major maintenance strategy that minimizes the total cost. Due to the stochastic features of the system, a simulation-based optimization approach is proposed, which combines the descriptive capabilities of simulation modeling with analytical models, statistical analysis, and optimization techniques. The results verify that the proposed simulation-optimization approach provides new and coherent results that highlight the strong influence of quality deterioration on the determination of the control parameters. A sensitivity analysis and a comparative study are conducted to illustrate that significant cost savings could be obtained with the proposed approach.