The authors describe a technique for nonkeyword rejection and evaluate it in the context of an audiotex service using the ten Spanish digits. The baseline keyword recognition system is a speaker-independent continuous-density hidden Markov model (HMM) recognizer. The use of an affine transformation to the log-probability of the garbage model, an HMM model trained to account for both nonkeyword speech and nonstationary telephone noises is proposed. The parameters of the transformation for the case of isolated keywords are chosen to minimize a cost function that weighs the keyword error rate, keyword rejection rate, and false acceptance rate according to the a priori probabilities of keyword/nonkeyword and the requirements of the specific application. This technique was also extended to embedded keywords (word spotting). The use of this rejection technique on the audiotext application reduced the total cost function by up to 20% for the isolated-word case and by up to 12% for the word spotting case.