In the present work microencapsulation was applied to an ergosterol enriched extract (EEE) from Agaricus bisporus L. and pure ergosterol (PE) using a complex coacervation process. The process was optimized following two steps: (i) using response surface methodology to optimize the conditions of temperature (T, 55 to 95°C), protein-to-chitosan ratio (P/C, 0.5 to 10.5), maximizing yield (Y 1 , %, w/w), efficiency (Y 2 , %, w/w) and load (Y 3 , %, w/w); and (ii) using the dose-response methodology to optimize the ergosterol content (E) at the optimal conditions achieved in (i). The global optimal conditions for both cases were the same (T of 55°C and a P/C of 0.5), but with maximized responses of Y 1 = 75.02%; Y 2 = 100.00%, Y 3 = 12.78%, and Y 1 = 19.19%; Y 2 = 100.00%, Y 3 = 15.87%, respectively. The effect of increasing ergosterol content led to the reduction of the microencapsulation yield, but with an increase in the ergosterol load and maintenance of the microencapsulation efficiency.