The development and application of a new methodology, in situ electrochemical X-ray fluorescence (EC-XRF), is described that enables direct identification and quantification of heavy metals in solution. A freestanding film of boron-doped diamond serves as both an X-ray window and the electrode material. The electrode is biased at a suitable driving potential to electroplate metals from solution onto the electrode surface. Simultaneously, X-rays that pass through the back side of the electrode interrogate the time-dependent electrodeposition process by virtue of the XRF signals, which are unique to each metal. In this way it is possible to unambiguously identify which metals are in solution and relate the XRF signal intensity to a concentration of metal species in solution. To increase detection sensitivity and reduce detection times, solution is flown over the electrode surface by use of a wall-jet configuration. Initial studies focused on the in situ detection of Pb2+, where concentration detection limits of 99 nM were established in this proof-of-concept study (although significantly lower values are anticipated with system refinement). This is more than 3 orders of magnitude lower than that achievable by XRF alone in a flowing solution (0.68 mM). In situ EC-XRF measurements were also carried out on a multimetal solution containing Hg2+, Pb2+, Cu2+, Ni2+, Zn2+, and Fe3+ (all at 10 μM concentration). Identification of five of these metals was possible in one simple measurement. In contrast, while anodic stripping voltammetry (ASV) also revealed five peaks, peak identification was not straightforward, requiring further experiments and prior knowledge of the metals in solution. Time-dependent EC-XRF nucleation data for the five metals, recorded simultaneously, demonstrated similar deposition rates. Studies are now underway to lower detection limits and provide a quantitative understanding of EC-XRF responses in real, multimetal solutions. Finally, the production of custom-designed portable in situ EC-XRF instrumentation will make heavy metal analysis at the source a very realistic possibility.