Image copyright EPA Image caption The crossings shut last month as tensions soared over militant attacks

Pakistan's Prime Minister Nawaz Sharif has ordered the country's two main border crossings with Afghanistan to reopen immediately.

Mr Sharif said the move was meant as a gesture of goodwill.

Pakistan shut the crossings last month after a spate of attacks it blamed on militants from over the border.

Thousands of people were stranded on both sides. The two countries have long blamed each other for not doing enough to tackle militants.

Earlier this month, Pakistan opened the crossings at Torkham and Chaman for two days amid rising concerns that continued closure could develop into a humanitarian crisis.

About 50,000 Afghans took advantage of the move and crossed back into their country.

About 6,000 or 7,000 Pakistanis travelled the other way.

The BBC's M Ilyas Khan in Islamabad says that by keeping the crossings shut for a month Mr Sharif will by now feel that he has made his point. He was also facing mounting pressure from traders frustrated by the closures.

Despite Mr Sharif's order, the crossings remained shut for much of Monday. The measure was expected to take effect later in the day or early on Tuesday, our correspondent said.