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 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.
Sharif would 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 has close ties with Sunni-majority Saudi Arabia but last year resisted calls by the Saudis to join a war in Yemen against the Houthi rebels allegedly supported by Shia-dominated Iran.
Pakistan is also not willing to contribute troops for the 34-nation Saudi alliance to fight terrorism.
