The decision was taken after behind-the-scene contacts by Pakistan with both countries to lower the temperature in the region after Saudi Arabia executed a prominent Shia cleric earlier this month following which Iranian protesters attacked the Saudi embassy in Tehran and its consulate prompting Riyadh to sever relations.
Iran then snapped all commercial ties with Saudi Arabia and stopped pilgrims from travelling to Mecca.
An official of the Prime Minister's House said Premier Sharif will first travel to Iran and meet President Hassan Rouhani and later the same day he will visit Saudi Arabia for a meeting with King Salman bin Abdul Aziz.
"He will try to convince the two leaders that their tension was adding to the problems faced by the Muslim world," he said.
Sharif would also be accompanied by Advisor on Foreign Affairs Sartaj Aziz and special assistant on foreign affairs Tariq Fatemi. He is expected to return home on Tuesday.
Pakistan is also not willing to contribute troops for the 34-nation Saudi alliance to fight terrorism.
