Let G be a connected graph with vertex set V (G), we define $\sigma _{2}(G)=\min \limits \{d(u)+d(v)$ for all non-adjacent vertices u,v ∈ V (G)}. Let Km,m+k be a complete bipartite graph with bipartition V (Km,m+k) = A ∪ B, |A| = m, |B| = m + k. Denote by H to be the graph obtained from Km,m+k by adding (or not adding) some edges with two end vertices in A. Let $\mathcal H$ be the set of all connected graphs H. In this paper, we prove that if G is a connected graph satisfying σ2(G) ≥|G|− k then G has a spanning k-ended tree except for the case G is isomorphic to a graph $H\in \mathcal H$ . This result is a generalization of the result by Broersma and Tuinstra (J. Graph Theory 29: 227–237, 1). On the other hand, we also give a sufficient condition for a graph to have a few branch vertices as a corollary of our main result.