In this research, a novel efficient analytical method for determination of alkylpyrazines (APs) in some food samples was developed based on head-space hollow fiber protected liquid phase microextraction (HS-HFLPME) method. In this method n-octanol was applied as extracting media which was inserted inside lumen of hollow fiber. The developed HFLPME method was used for the preconcentration and extraction of APs including methyl pyrazine, 2,3-dimethyl pyrazine, 2,5-dimethylpyrazine, 2,3,5-trimethyl pyrazine and 2,3,5,6-tetramethyl pyrazine in cocoa and chocolate-milk samples followed by detection applying gas chromatography-flame ionization detector. Important parameters influencing the HS-HFLPME process including extraction time, extraction temperature, salt content and the desorption solvent volume were investigated and optimized applying response surface methodology based on central composite design. Considering the method validation, developed method linear dynamic ranges were 1-200 and 5-500 ng mL(-1) for various analytes and the limits of detection were in the range of 0.3 to 1 ng mL(-1). The method precision (RSD%) was evaluated by six replicate experiments and RSD% values were obtained in the range of 0.8 to 8.2% for the distilled water (100 ng mL(-1)). The developed method was used successfully for measurement of AP compounds in cocoa and chocolate-milk samples and the relative recovery percentages (RR%) in the range of 71.7 to 110.5% were obtained.