This paper extends the extant literature to consider that the selling price of the product sold with warranty policy is a function of the length of the warranty period for an imperfect production system. A product under a free replacement/repair warranty policy is considered and the lifetime distribution of the product is assumed to be exponentially distributed. We seek to maximize the total profit per item through optimal determinations of the production run length and the warranty period. Based on the proposed mathematical model, we will derive some lemmas and the propositions to carry out an efficient solution procedure to determine the optimal warranty period and production run length. The numerical examples are given to illustrate the features of the proposed maximizing profit model and to show all of the possible cases of the solution procedure.