The Shaheen II missile has a range of 2000km and it successfully hit the target, said Major General Shaukat Sultan, spokesman for the Pakistan army.
He did not say where the test was conducted.
Pakistan's president, General Pervez Musharraf, witnessed the test and has congratulated the scientists and engineers for developing the missile, the military said in a statement.
"This missile which incorporates an advanced two-stage solid motor technology, can carry all types of conventional and nuclear warheads," the statement said.
South Asian nuclear rivals Pakistan and India routinely test-fire their missiles.
In December 2004, Pakistan launched the Shaheen I missile, which can hit targets up to 700km away.
The Shaheen II test comes two days after the US Secretary of State Condoleezza Rice visited Pakistan to encourage Pakistan's peace process with India.
There was no immediate reaction from New Delhi to the test.