This paper investigates the optimal portfolio investment policies of an insurer with Markov-modulated jump-diffusion risk process. Assume that there are two asset available for the insurer: a risk-free asset and a risky asset. The market interest rate, the drift and the volatility of the risky asset, and the premium rate of the insurer and claim arrival intensity switch over time according to transitions of the Markov chain. Given an insurer maximizing utility from terminal wealth, we present a verification result for portfolio problems, and obtain the explicit forms of the optimal policy with CARA utility function. And we conduct Monte Carlo simulation and perform a sensitivity analysis of the optimal asset allocation strategies and the terminal expected utility.