This paper assesses whether Brazilian primary health care is worth it in the long‐run by estimating the accumulated costs and benefits of its flagship, the Family Health Strategy program (ESF). We employ an alternative strategy centered on years of exposure to the program to incorporate its dynamics. We also account for the program's heterogeneity with respect to the remuneration of ESF health teams and the intensity of coverage across Brazilian municipalities, measure by the number of people assisted by each ESF team, on average. To address heterogeneity in professional earnings, this paper employs, for the first time, a dataset containing the remuneration of professionals allocated to all ESF teams nationwide. The benefits are measured by the avoided deaths and hospitalizations due to causes sensitive to primary care. Results suggest that the net monetary benefit of the program is positive on average, with an optimum time of exposure of approximately 16 years. Significant heterogeneities in cost‐benefit results were found since costs outweigh benefits in localities where the coverage is low intensive. On the other hand, the benefits outweigh the costs by 22.5% on average in municipalities with high intensive coverage.