The explosions occurred within minutes of each other.
Pakistani police say they suspect a coordinated suicide attack, but the army is less sure.
Army spokesman Major General Waheed Arshad said it was too early to determine whether the explosions were suicide bombings or the result of remote detonated blasts.
The first bomb targeted a bus that was transporting Defense Ministry employees to their offices. Police chief Marwat Ali Shah said it killed 16 people and injured more than 20.
Television footage showed rescue workers trying to cut open the wreckage of the bus to pull out the dead and injured.
Police chief Shah said the second bomb was rigged to a motorcycle that was parked in a market area of Rawalpindi, less than 300 meters from the headquarters of Pakistan's army. It killed at least eight people and injured more than 40.
There was no immediate claim of responsibility for either blast. But security officials suspect the bombings were the work of Islamic militants, possibly in response to Pakistani military operations in the tribal regions near the Afghan border.
In the past, officials have blamed similar attacks on pro-Taliban and Al-Qaeda militants.
Rawalpindi adjoins the capital, Islamabad, and includes the residences of President Pervez Musharraf and other top military and political officials.
Uncertainty Ahead Of Double Elections
The explosions could deepen the sense of crisis in Pakistan amid political uncertainty as preparations move forward for presidential and parliamentary elections due to take place in the coming weeks.
Musharraf and Prime Minister Shaukat Aziz have both condemned the attacks.
Aziz vowed that those involved in the bombings would be brought to justice. He said militancy and extremism were harming Pakistani society.
Pakistan has seen a spike in violence against security forces since troops stormed the radical Red Mosque in Islamabad in July.
More than 300 people have been killed in what are seen as retaliatory attacks, while pro-Taliban militants have taken scores of Pakistani soldiers prisoner in border areas.
In particular, there has been a backlash of attacks by militants in the tribal areas near the border with Afghanistan. In July, two suicide bombings in Islamabad also killed at least 30 people.
The deteriorating security situation and political instability prompted Musharraf to consider imposing emergency rule in August.
With the approach of elections, ministers have expressed concern about the security of related public events.
But government officials said today's bombings would not lead to emergency rule in Pakistan.
EYE OF A STORM:
Afghan officials first suggested that insurgents or terrorists were crossing the border from Pakistan in 2003. Relations have run hot and cold ever since. But the roots of the problem go back much further.
Click here to view PHOTO GALLERY