Pakistan secured the funds by leveraging investor interest, which grew after the country received credit rating upgrades in the past couple of months.