This paper is devoted to the study of a clearing queueing system with a special discipline. As soon as the server receives N negative feedbacks from customers, all present customers are forced to leave the system and the server undergoes a maintenance procedure. After an exponential maintenance time, the system resumes its service immediately. Using the matrix analytic method, we derive the steady-state distributions, which are then used for the computation of other performance measures. Furthermore, using first step analysis, we obtain the Laplace–Stieltjes transform of the sojourn time of an arbitrary customer. We also study the busy period of the system and derive the generating function of the total number of lost customers in a busy period. Finally, we investigate a long-run rate of cost and explore the optimal N value that minimizes the total cost per unit time. We also present some numerical examples to illustrate the impact of several model parameters to the performance measures.