SIHANOUKVILLE, Cambodia—China has signed a secret agreement allowing its armed forces to use a Cambodian navy base near here, as Beijing works to boost its ability to project military power around the globe, according to U.S. and allied officials familiar with the matter.

The pact—signed this spring but not disclosed by either side—gives China exclusive rights to part of a Cambodian naval installation on the Gulf of Thailand, not far from a large airport now being constructed by a Chinese company.

Some...