The coronavirus disease 2019 (COVID-19) pandemic has posed a severe threat to public health and economic activity. Governments all around the world have taken positive measures to, on the one hand, contain the epidemic spread and, on the other hand, stimulate the economy. Without question, tightened anti-epidemic policy measures restrain people’s mobility and deteriorate the levels of social and economic activity. Meanwhile, loose policy measures bring little harm to the economy temporarily but could accelerate the transmission of the virus and ultimately wreck social and economic development. Therefore, these two kinds of governmental decision-making behaviors usually conflict with each other. With the purpose of realizing optimal socio-economic benefit over the full duration of the epidemic and to provide a helpful suggestion for the government, a trade-off is explored in this paper between the prevention and control of the epidemic, and economic stimulus. First, the susceptible–infectious–recovered (SIR) model is introduced to simulate the epidemic dynamics. Second, a state equation is constructed to describe the system state variable—the level of socio-economic activity dominated by two control variables. Specifically, these two variables are the strengths of the measures taken for pandemic prevention and control, and economic stimulus. Then, the objective function used to maximize the total socio-economic benefit over the epidemic’s duration is defined, and an optimal control problem is developed. The statistical data of the COVID-19 epidemic in Wuhan are used to validate the SIR model, and a COVID-19 epidemic scenario is used to evaluate the proposed method. The solution is discussed in both static and dynamic strategies, according to the knowledge of the epidemic’s duration. In the static strategy, two scenarios with different strengths (in terms of anti-epidemic and economic stimulus measures) are analyzed and compared. In the dynamic strategy, two global optimization algorithms, including the dynamic programming (DP) and Pontryagin’s minimum principle (PMP), respectively, are used to acquire the solutions. Moreover, a sensitivity analysis of model parameters is conducted. The results demonstrate that the static strategy, which is independent of the epidemic’s duration and can be easily solved, is capable of finding the optimal strengths of both policy measures. Meanwhile, the dynamic strategy, which generates global optimal trajectories of the control variables, can provide the path that leads to attaining the optimal total socio-economic benefit. The results reveal that the optimal total socio-economic benefit of the dynamic strategy is slightly higher than that of the static strategy.