This paper studies a dynamic optimal reinsurance and dividend-payout problem for an insurer in a finite time horizon. The goal of the insurer is to maximize its expected cumulative discounted dividend payouts until bankruptcy or maturity which comes earlier. The insurer is allowed to dynamically choose reinsurance contracts over the whole time horizon. This is a mixed singular-classical control problem and the corresponding Hamilton-Jacobi-Bellman equation is a variational inequality with fully nonlinear operator and with gradient constraint. The $C^{2,1}$ smoothness of the value function and a comparison principle for its gradient function are established by penalty approximation method. We find that the surplus-time space can be divided into three non-overlapping regions by a risk-magnitude-and-time-dependent reinsurance barrier and a time-dependent dividend-payout barrier. The insurer should be exposed to higher risk as surplus increases; exposed to all the risks once surplus upward crosses the reinsurance barrier; and pay out all reserves in excess of the dividend-payout barrier. The localities of these regions are explicitly estimated.