Optimum measurement parameters for analysis of soil and sediment samples with the compact MiniPal 4 (MP4)EDXRF spectrometer (PANalytical, Almelo, The Netherlands) were presented. The following elements were considered: K, Ca, Ti, V, Cr, Mn, Fe, Ni, Cu, Zn, As and Pb. Since the elements from low Z to medium Z region were covered, three measurement conditions (sequences) were defined. The following parameters were selected for measurement of the elements K, Ti, and V: voltage = 12 kV; current = 750 µA; filter material: Al thin. Cr, Mn and Fe were measured at 20 kV; 300 µA with Al filter while for measurements of Ni, Cu, Zn, As, Pb, Rb, and Sr an Ag filter was selected and tube voltage and current were 30 kV and 300 µA. Each sequence was measured for 200 s and measurements were done in the air. MP4 spectrometer was characterized with acceptable precision, long-term stability and satisfactory minimum detection limit for the analyses of soil and sediment materials. For the elements K, Mn, Fe, and Ti the precision of the analysis was better than 0.5% and for all the other elements better than 5%. Detection limits for sediment samples were 20 ppm for K, 6.1 ppm for Ti, 5.2 for Mn, 4 ppm for Fe, 4.2 ppm for As and less than 2 ppm for all the other elements. These values were significantly lower compared to typical concentrations of the same elements found in unpolluted soil and sediments.