A portable x-ray fluorescence spectrometer has a portable sensor unit containing a battery, a high voltage power supply, an x-ray tube which produces a beam x-ray radiation directed toward a target sample, and a detector for fluorescent x-rays produced by the sample. If a silicon-lithium detector is used, the sensor unit also contains either a thermoelectric or thermochemical cooler, or a small dewar flask containing liquid nitrogen to cool the detector. A pulse height analyzer (PHA) generates a spectrum of data for each sample consisting of the number of fluorescent x-rays detected as a function of their energy level. The PHA can also store spectrum data for a number of samples in the field. A processing unit can be attached to the pulse height analyzer to upload and analyze the stored spectrum data for each sample. The processing unit provides a graphic display of the spectrum data for each sample, and provides qualitative and/or quantitative analysis of the elemental composition of the sample by comparing the peaks in the sample spectrum against known x-ray energies for various chemical elements. An optional filtration enclosure can be used to filter particles from a sample suspension, either in the form of a natural suspension or a chemically created precipitate. The sensor unit is then temporarily attached to the filtration unit to analyze the particles collected by the filter medium