A block graph is a graph whose blocks are cliques. For each edge of a graph , let denote the set of all vertices in which are closer to than . In this paper we prove that a graph is a block graph if and only if it satisfies two conditions: (a) The shortest path between any two vertices of is unique; and (b) For each edge , if and , then, and only then, the shortest path between and contains the edge . This confirms a conjecture of Dobrynin and Gutman [A.A. Dobrynin, I. Gutman, On a graph invariant related to the sum of all distances in a graph, Publ. Inst. Math., Beograd. 56 (1994) 18–22].