The optimal scaling law of secrecy capacity as well as the corresponding achievable scheme have not been fully investigated in ad hoc networks. In this paper, we consider an ad hoc network with eavesdroppers and propose a jamming-aided hierarchical cooperation scheme that achieves the maximum throughput scaling with perfect secrecy in the presence of a given number of eavesdroppers. Our proposed scheme can achieve the linear secrecy capacity scaling in a dense network, while it can achieve the linear or smaller capacity scaling in an extended network, which varies with a path loss exponent. Considering two different networks, which are dense and extended networks, we derive the tolerable intensities of eavesdroppers required for optimal secrecy capacity scaling with our proposed scheme. Our results show that our proposed scheme well achieves optimal secrecy capacity scaling regardless of eavesdroppers' movements. We also reveal that with zero jamming power, our proposed scheme obtains the same scaling law only when the very small number of eavesdroppers exist.