A computer readable non-transitory storage medium storing a focusing control program causing a computer to perform:
- a focusing control step of selectively performing focusing control by a phase difference AF method using a result of a correlation operation of detection signals of first signal detection parts that detect signals corresponding to one of a pair of luminous fluxes passed through different portions of a pupil area of an imaging optical system and detection signals of second signal detection parts that detect signals corresponding to other one of the pair of luminous fluxes or focusing control by a contrast AF method using contrast of a captured image captured by an imaging element that images a subject through the imaging optical system, in a case where focusing control for focusing on a main subject by driving a focus lens of the imaging optical system including the focus lens is continuously performed multiple times,
- wherein, in the focusing control step, the focusing control by the contrast AF method is performed in a case where a state in which a degree of reliability of the focusing control by the phase difference AF method is equal to or less than a threshold value persists N times, N being a natural number of 2 or more, while the focusing control by the phase difference AF method is continuously performed,
- or
- wherein, in the focusing control step, the focusing control using the contrast AF method is performed in a case where the state in which the degree of reliability is equal to or less than the threshold value persists less than N times and an elapsed time after the degree of reliability is equal to or less than the threshold value reaches a time threshold value while the focusing control using the phase difference AF method is continuously performed.