The Prime Minister also hoped that the Afghan Government would take measures to address the reasons for which the borders were closed by Pakistan.
He said recent incidents of terrorism in Pakistan have been traced back to anti-Pakistan elements in Afghanistan.
According to an official statement, Sharif also said that he reiterated time and again that durable peace in Afghanistan is imperative for peace and security in Pakistan.
The busy border was closed last month for indefinite period following a string of deadly militant attacks for which Pakistan accused terrorists hiding in Afghanistan.
More From This Section
The border remained shut except its temporary opening for two days to let more than 50,000 stranded people cross over.
Since then, traders have complained of daily losses and prices of goods imported from Pakistan rose sharply in Afghanistan.
Sharif ordered that the border should be reopened immediately "as a goodwill gesture," the statement said.
"The decision to re-open the border is being taken as closure of the border for a long time in the backdrop of religious, culture and historical ties between the two countries would not be in the interest of the people and the economy," said Sharif.
The two-way annual trade is between USD 1.5-2 billion. The two sides had planned to increase to 5 billion dollars but frequent closure of border by Pakistan due to security reasons is one of the hurdles to increase the trade, an official said.
The decision to reopen that border came after last week's meeting between the Advisor on foreign affairs Sartaj Aziz and Afghan National Security Advisor Hanif Atmar in London.
UK's National Security Advisor Mark Lyall Grant hosted the meeting.