In this paper, we study the Gerber–Shiu discounted penalty function in the classical risk model with impulsive dividends. When the surplus process hits a barrier b, the dividend will be paid and the surplus is reduced to a level a. An integro-differential equation for the Gerber–Shiu discounted penalty function is derived by analyzing the evolution of the surplus process and it is solved by Dickson–Hipp operator method. For this process, we also investigate the Laplace transform of the time of ruin, the distribution of the surplus immediately before ruin and the deficit at ruin. These quantities for the special case where the claim size is exponentially distributed are obtained explicitly. Moreover, the distribution of the number of dividends is derived.