In the classical Cramér–Lundberg model in risk theory the problem of maximizing the expected cumulated discounted dividend payments until ruin is a widely discussed topic. In the most general case within that framework it is proved [Gerber, H.U., 1968. Entscheidungskriterien fuer den zusammengesetzten Poisson-prozess. Schweiz. Aktuarver. Mitt. 1, 185–227; Azcue, P., Muler, N., 2005. Optimal reinsurance and dividend distribution policies in the Cramér–Lundberg model. Math. Finance 15 (2) 261–308; Schmidli, H., 2008. Stochastic Control in Insurance. Springer] that the optimal dividend strategy is of band type. In the present paper we discuss this maximization problem in a generalized setting including a constant force of interest in the risk model. The value function is identified in the set of viscosity solutions of the associated Hamilton–Jacobi–Bellman equation and the optimal dividend strategy in this risk model with interest is derived, which in the general case is again of band type and for exponential claim sizes collapses to a barrier strategy. Finally, an example is constructed for Erlang(2)-claim sizes, in which the bands for the optimal strategy are explicitly calculated.