An SPE-HPTLC method for simultaneous identification and quantification of seven pharmaceuticals in production wastewater was optimized and validated. The studied compounds were enrofloxacine, oxytetracycline, trimethoprim, sulfamethazine, sulfadiazine, sulfaguanidine and penicillin G/procaine. The method involves solid-phase extraction on hydrophilic-lipophilic balance cartridges with methanol and HPTLC analysis of extracts on CN modified chromatographic plates followed by videodensitometry at 254 and 366 nm. Optimization of chromatographic separation was performed by systematic variation of the mobile phase composition using genetic algorithm approach and the optimum mobile phase composition for TLC separation was 0.05 M H2C2O4:methanol = 0.81:0.19 (v/v). Linearity of the method was demonstrated in the ranges from 1.5 to 15.0 mu g L-1 for enrofloxacine, 100-500 mu g L-1 for oxytetracycline, 150-600 mu g L-1 for trimethoprim, 300-1100 mu g L-1 for sulfaguanidine and 100-400 mu g L-1 for sulfamethazine, sulfadiazine and penicillin G/procaine with coefficients of determination higher than 0.991. Mean recoveries ranged from 74.6 to 117.1% and 55.1 to 108.0% for wellspring water and production wastewater, respectively. Only sulfaguanidine showed lower results. The described method has been applied to the determination of pkarmaceuticals in wastewater samples from pharmaceutical industry.