Perceptual decisions, especially for difficult stimuli, can be influenced by choices and outcomes in previous trials. However, it is not well understood how stimulus strength modulates the temporal characteristics as well as the magnitude of trial history influence. We addressed this question using a contrast detection task in freely moving mice. We found that, at lower as compared to higher stimulus contrast, the current choice of the mice was more influenced by choices and outcomes in the past trials and the influence emerged from a longer history. To examine the neural basis of stimulus strength-dependent history influence, we recorded from the secondary motor cortex (M2), a prefrontal region that plays an important role in cue-guided actions and memory-guided behaviors. We found that more M2 neurons conveyed information about choices on the past two trials at lower than at higher contrast. Furthermore, history-trial activity in M2 was important for decoding upcoming choice at low contrast. Thus, trial history influence of perceptual choice is adaptive to the strength of sensory evidence, which may be important for action selection in a dynamic environment