Live video of the launch showed the first and second stages of the rocket separating about two and a half minutes into the flight.
The larger, first stage, made a gentle arc and powered its nitrogen thrusters to guide it back to Earth.
The rocket then set itself down, gently and steadily, in the center of the 300-foot (91-meter) circular landing zone.
Musk is leading an effort in the rocket industry to re-use costly parts rather than jettison them into the ocean after each launch.
SpaceX has already made multiple successful landings, some on floating platforms - known as drone ships - in the ocean.
The launch was initially planned for Sunday, but was postponed in the last seconds before liftoff due to a sensor issue with the rocket, SpaceX said.
The sensor in question was replaced ahead of Monday’s attempt. Little was known about the payload due to its classified nature.
"As a matter of policy and because of classification, NRO does not provide information about our contracts," a spokeswoman told AFP. Until now, the US military has spent billions per year exclusively with United Launch Alliance, a joint operation of aerospace giants Boeing and Lockheed Martin, to launch government satellites.
SpaceX in 2014 protested the US Air Force’s practice of using only ULA, saying it unfairly awarded billions of dollars to a single company for national security launches.
SpaceX to was selected to launch NROL-76 "after a competition," said the NRO spokeswoman. She said she did not know when the contract was awarded. The contract was first announced last year.
SpaceX regularly launches unmanned cargo ships to the International Space Station, and is working on a crew capsule that could carry humans into orbit as early as next year.
SpaceX blasts off a secretive US government payload, known only as NROL-76. ||It marks the first military launch for the California-based aerospace company headed by Elon Musk.