We find the conditions for the unique solvability of the inverse problem for a time‐fractional diffusion equation with Schwarz‐type distributions in the right‐hand sides. This problem is to find a generalized solution of the Cauchy problem and an unknown space‐dependent part of an equation's right‐hand side under a time‐integral overdetermination condition.