Detection of hierarchical community structures is one of the most crucial tasks for analyzing complicated social networks. In a hierarchical community structure, the super node at a higher level represents a nested structure so that the relationship of subcommunities in a community can be observed. Most of the previous works focused on designing metaheuristics for detecting hierarchical community structures, which may be computationally efficient, but cannot always guarantee the community partition optimality. Hence, this paper proposes an integer linear programming model for detecting the hierarchical community structure in social networks, which takes into account the number of levels and the limit of community size of each level. Our experimental results show that our model can find a reasonable hierarchical community structure, where the interaction between communities at different levels can be comprehended more clearly.