The purpose of this study is to investigate the impact of a sudden shock from the COVID-19 epidemic on the behavioral bias of investors in the stock market of Iran as a developing country. The study also examines whether the government response to the COVID-19 pandemic can reduce investor herding behavior. We have used the Cross-sectional absolute deviation (CSAD) to measure securities dispersion from market returns. The studied period includes the cross-sectional data of the top 50 companies listed on the stock exchange during 2381 working days of the market (from March 1, 2012, to March 1, 2022). Furthermore, we use the semi-parametric estimator of the quantile regression for the data on the Iranian government response during the COVID-19 epidemic taken from the Oxford COVID-19 Government Response Tracker (OxCGRT). The main findings are in order. First, results show that the COVID-19 pandemic caused the formation of herding behavior aggravated by market volatility. Second, we document that the government response stringency index is unsuccessful in reducing investor herding behavior in the Iranian stock market. Finally, given the evidence that herding behavior, as a form of behavioral distortion, can drive security prices away from equilibrium values supported by fundamentals and cause price bubbles, our findings have important implications for policymakers and investors to mitigate herding effects and mis valuations.