A group G is said to be a Bk-group if for any k-subset {a1,…,ak} of G, |{aiaj∣1≤i,j≤k}|≤k(k+1)2. In this paper, a complete classification of B5-groups is given.