Summary: This paper studies optimal investment strategies of an insurance company. We assume that the insurance company receives premiums at a constant rate, the total claims are modeled by a compound Poisson process, and the insurance company can invest in the money market and in a risky asset such as stocks. This model generalizes the model of {\it C. Hipp} and {\it M. Plum} [Insur. Math. Econ. 28, No. 2, 215--228 (2000;

Zbl 1007.91025)] by including a risk-free asset. The investment behavior is investigated numerically for various claim-size distributions. The optimal policy and the solution of the associated Hamilton-Jacobi-Bellman equation are then computed under each assumed distribution. Our results provide insights for managers of insurance companies on how to invest. We also investigate the effects of changes in various factors, such as stock volatility, on optimal investment strategies, and survival probability. The model is generalized to cases in which borrowing constraints or reinsurance are present.