In this paper, we investigated the dynamics of a diffusive delayed predator-prey system with Holling type II functional response and nozero constant prey harvesting on no-flux boundary condition. At first, we obtain the existence and the stability of the equilibria by analyzing the distribution of the roots of associated characteristic equation. Using the time delay as the bifurcation parameter and the harvesting term as the control parameter, we get the existence and the stability of Hopf bifurcation at the positive constant steady state. Applying the normal form theory and the center manifold argument for partial functional differential equations, we derive an explicit formula for determining the direction and the stability of Hopf bifurcation. Finally, an optimal control problem has been considered.