Erdős determined the maximum size of a nonhamiltonian graph of order n and minimum degree at least k in 1962. Recently, Ning and Peng generalized Erdős’s work and gave the maximum number of s-cliques hs(n,c,k) of graphs with prescribed order n, circumference c and minimum degree at least k. But for some quadruples n,c,k,s the maximum number of s-cliques is not attained by a graph of minimum degree k. For example, h2(15,14,3)=77 is attained by a unique graph of minimum degree 7, not 3. In this paper we obtain more precise information by determining the maximum number of s-cliques of a graph with prescribed order, circumference and minimum degree. As a corollary of our main result, we determine the maximum size of a k-connected graph with given order and circumference. Consequently we solve the corresponding problem for longest paths.