This paper discusses an integrated model of batch production and maintenance scheduling on flow shop with two deteriorating machines producing single item to be delivered at a due date. The model describes the trade-off between production and maintenance costs as the production run length increases on two machines. The objective function of the model is to minimize the total cost consisting of in process and completed part inventory costs, setup costs, preventive & corrective maintenance costs and rework costs on two machines. The step-wise optimization algorithm is developed to solve a mixed integer quadratic programming. Comparison with the practice and the model sensitivity analysis are demonstrated to clarify how the algorithm works.