In this paper, a Mamdani-type fuzzy controller is proposed as the controller part of an artificial pancreas. The controller is optimized with the artificial bee colony optimization algorithm. The glucose insulin regulatory system, based on a nonlinear differential model in the presence of delay, is used both for virtual patient and healthy person data. The main target of the controller is to mimic a blood glucose concentration profile of the healthy person with exogenous insulin infusion. Simulations are performed to assess the control function in terms of tracking the blood glucose concentration profile of the healthy person and minimizing errors. To show robustness, a group of three tests are implemented. These tests include unusual glucose intake, sensor noise, and uncertainty in the clearance rate parameter. The simulation results demonstrate that the adopted method is more effective than similar studies in the literature.