We consider the classical optimal dividend control problem which was proposed by de Finetti [Trans. XVth Internat. Congress Actuaries 2 (1957) 433-443]. Recently Avram, Palmowski and Pistorius [Ann. Appl. Probab. 17 (2007) 156-180] studied the case when the risk process is modeled by a general spectrally negative Levy process. We draw upon their results and give sufficient conditions under which the optimal strategy is of barrier type, thereby helping to explain the fact that this particular strategy is not optimal in general. As a consequence, we are able to extend considerably the class of processes for which the barrier strategy proves to be optimal.