The Accountant General of Pakistan told a three-judge bench headed by Chief Justice Iftikhar Chaudhry that he was threatened by Ashraf to secure the funds.
The court was hearing a case over the release of funds for several projects a day before the previous government's term ended in March.
The Chief Justice said billions of rupees were released for development schemes on March 15, a day before the national and provincial assemblies were dissolved.
Chaudhry also questioned the Accountant General whether he had scrutinised the funds that Ashraf had sanctioned for himself from time to time.
The apex court ordered a special audit of expenses incurred on projects sanctioned by Ashraf using discretionary funds.
The bench issued notices to the former premier's principal secretary, federal Finance Secretary, Sui Northern Gas Corporation, Sui Southern Gas Corporation, Water and Power Development Authority and other institutions and sought records of expenses incurred from the Prime Minister's discretionary fund.
The charges against Ashraf date back to his tenure as Power Minister.
The alleged corruption in setting up rental power projects led to Ashraf being nicknamed "Raja Rental".
Ashraf suffered a humiliating defeat in the May 11 general elections in a parliamentary constituency in his hometown of Gujjar Khan near Rawalpindi.
