The suicide bomber who caused a blast near Prophet Mohammed's mosque in the Saudi city of Medina on Monday killed 4 police officers and seriously injured four others, the Saudi Al Arabiya TV reported.
The bomber targeted the parking lots of the emergency forces vehicles in the west side of Medina near the grand mosque while policemen were having their fast-breaking meal.
"The government and people of Pakistan are deeply shocked and saddened over the terrorist attacks in holy land and share the pain and grief of their Saudi brethren," Nawaz Sharif said.
The Saudi Interior Ministry said early Tuesday that the suicide bomber Abdullah Waqar Khan was a Pakistani national.
The ministry said on official Twitter that the bomber had been residing in Jeddah with his wife and her parents for 12 years and had been working as chauffeur.
Saudi officials also released the photograph of the bomber on his identity card.
The Pakistani Prime Minister stressed that the international community in general and the Muslims in particular need to forge unity at this critical moment to foil the nefarious designs of enemies of humanity and the Islamic nations.
"We need to renew collective efforts to fight the menace of terrorism," Nawaz Sharif said and reiterated Pakistan's condemnation of terrorism in all its forms and manifestations. He said Pakistan stands firm against every act of terrorism.
Pakistani army chief, General Raheel Sharif, spoke to the Saudi Defence Minister Muhammad bin Salman and condemned the terrorist attack.