This paper is focused on closed-loop control of postprandial glucose levels of patients with type 1 diabetes mellitus after unannounced meals, still a major challenge towards a fully autonomous artificial pancreas. The main limitations are the delays introduced by the subcutaneous insulin pharmacokinetics and the glucose sensor, which typically lead to insulin over-delivery. Current solutions reported in the literature typically resort to meal announcement, which requires the patient intervention. In this paper, a disturbance observer is used to estimate the effect of unannounced meals and the insulin pharmacokinetics is taken into account by means of a feedforward compensator. The proposed strategy is validated in silico with the UVa/Padova metabolic simulator. It is demonstrated how the disturbance observer successfully estimates and counteracts not only the effect of meals but also sudden drops in the glucose levels that may lead to hypoglycemia. For unannounced meals, results show a median time-in-range of 80% in a 30-day scenario with high carbohydrate content and large intra-subject variability. Optionally, users may decide to announce meals. In this case, considering severe bolus mismatch due to carbohydrate counting errors, the median time-in-range is increased up to 88%. In every case, hypoglycemia is avoided.