The imaging lens consists of, in order from the object side, a positive first lens group that moves to the object side during focusing from a long distance to a short distance, and a second lens group that does not move during focusing. The first lens group has a first-B sub-lens group. The first-B sub-lens group consists of, in order from the object side, a positive b1 lens, a negative b2 lens concave toward the image side, an aperture stop, a negative b3 lens concave toward the object side, and a positive b4 lens. The second lens group consists of, in order from the object side, a negative lens, a positive lens, and a negative lens. Predetermined conditional expressions are satisfied.