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.
He questioned the accountant general whether he did not know about restrictions imposed on release of funds by the Election Commission.
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 Supreme Court is also investigating allegations that Ashraf was involved in corruption in setting up rental power projects.
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.
Zardari blames 'international forces' for poll debacle
Allahabad HC rejects Talwars' plea to examine witnesses
How illegal salt making threatens Sambhar Lake's ecology
I should have quit presidency to lead PPP: Zardari
Pakistanis vote in historic polls, 24 killed in violence