It has been reported that detectors made of lanthanum-cerium halides (LaBr3:Ce and CeBr3) have superior energy resolution for gamma-radiation detection compared to what is offered by conventional sodium iodide (NaI:T1) detectors. Although superior energy resolution may be observed, one major barrier that has hindered the rapid adaptation of lanthanum halides is their self-activity, due primarily to the presence of isotope 138La, and the α contamination, due to the trace amount of actinides. It has also been observed that the lanthanum-cerium halides contain a substantial amount of self-activity caused by the radioactive isotope 138La. Additionally, LaBr3:Ce spectra are also affected by β contaminations in the low-energy region. To use either LaBr3:Ce or CeBr3 for high-sensitivity gamma detection, it may be necessary to have the self-activity as well as α and β contaminations removed or reduced. This paper describes a novel algorithmic approach for self-activity and contamination reduction for LaBr3:Ce and CeBr3 detectors using a third reference NaI:T1 detector. We present a computational procedure for separating self-activity from the gamma spectra obtained by LaBr3:Ce detectors. With the self-activity spectra precalculated, it is possible to perform real-time self-activity removal. This procedure can be implemented as an automatic self-activity subtraction module for gamma-radiation detectors made of LaBr3:Ce and/or CeBr3 crystals. With this approach, it is possible to develop a new generation of LaBr3:Ce detectors capable of producing spectra as clean as those obtained by conventional NaI:T1 detectors, but with much improved energy resolutions.