The simultaneous analysis of aflatoxins B1, G1, B2, G2 and ochratoxin A in beer was carried out by ultra-performance liquid chromatography/tandem mass spectrometry (UPLC/MS/MS). Mycotoxins were extracted, purified and concentrated from the beer sample in one step using a solid-phase extraction (SPE) cartridge that contained a polymeric sorbent. Optimization of different parameters, such as type of SPE sorbent, type and amount of wash solvent and pH of the sample, was carried out. The mobile phase consisted of a gradient of methanol + water (0.1% HCOOH) and a reversed-phase C18 column was used for the separation. The mass spectrometer used an electrospray ionization source operated in the positive mode to detect aflatoxins and in the negative mode to detect ochratoxin. UPLC/MS/MS is a rapid and sensitive technique that allows the separation of the five toxins in only 3.2 min. The limit of detection is 1 pg.