Saudi Arabia's Crown Prince Mohammed bin Salman ordered the release of 2,107 Pakistani prisoners being held in his country at the request of Pakistani leader Imran Khan on Monday.
The prisoner release comes after Prince Mohammed said Riyadh will make significant investments in Pakistan to save the country's ailing economy.
The Saudi royal's move was welcomed by Pakistan's government, which thanked Prince Mohammed for his decision.
More than 2,000 prisoners will be freed immediately, while the remaining cases will be reviewed, Pakistan's foreign ministry said.
Prince Mohammed announced an investment of $20 billion (Dh73.45bn) in Pakistan when he touched down in Islamabad on Saturday, with the promise of more to come.
He said it was the "first phase" of a series of investments that "will certainly grow each month and every year".
The Saudi royal was welcomed to the Pakistani capital on Sunday by JF-17 and F-16 fighter jets, which escorted his plane as it entered Pakistani airspace.