Uncovering the underlying community structure of a social network is an important task in social network analysis. To solve this problem, many community detection algorithms for the full topology of an original social network have been proposed. However, these algorithms are not very effective at analyzing large-scale social networks. To overcome this deficiency, this paper proposes a community detection algorithm based on graph compression. Specifically, a compressed graph is first obtained by iteratively merging vertices with a degree of 1 or 2 into their neighbors with a higher degree. Then, two indices, i.e., the density and quality of vertices, are defined to evaluate the probability of vertices as community seeds. By considering these two measures together, in a compressed social network, the number of communities and the corresponding initial community seeds are determined simultaneously. After obtaining the community structure of the compressed social network via seed expansion, the community results are propagated to the original social network. Extensive experiments conducted on various social networks have demonstrated the superiority of our proposal compared to several existing state-of-the-art community detection algorithms.