Saudi Arabia pledged $3 billion (AED 11 billion) to Pakistan on Tuesday as the South Asian country battles a balance of payment crisis, a statement from Islamabad said.
It also agreed to provide up to the same amount again on deferred payment for import of oil, the announcement added.
The agreement came between the two countries during a visit by Prime Minister Imran Khan to Riyadh where he met King Salman.
The new Pakistan leader also attended a Saudi Arabian investment conference where he launched a charm offensive targeting potential investors, continuing to seek funding to plug deteriorating finances.
The summit, nicknamed "Davos in the desert", has been overshadowed by growing global outrage over the murder of journalist and Saudi government critic Jamal Khashoggi.
The two countries "agreed Saudi Arabia will place a deposit of USD 3 Billion for a period of one year as balance of payment support", said the statement.
"It was also agreed that a one year deferred payment facility for import of oil, up to $3 billion, will be provided by Saudi Arabia.
"This arrangement will be in place for three years, which will be reviewed thereafter."
During his address at the troubled Future Investment Initiative (FII) in Riyadh, Mr Khan confirmed that Pakistan was also in talks with the International Monetary Fund (IMF) over a new bailout.
The prime minister's attendance at the FII comes as leading policy-makers and corporate chiefs shunned the conference in response to the death of Khashoggi at the Saudi consulate in Istanbul -- a scandal that has tipped Riyadh into a diplomatic crisis.
Since taking power in August, Mr Khan has also sought loans from allies such as China and Saudi Arabia, promised to recover funds stolen by corrupt officials, and embarked on a series of high-profile populist austerity measures.
But help has been in short supply and economists' warnings have grown increasingly urgent.
The Saudi pledge comes days after Pakistan's central bank warned inflation could double in the coming year - hitting 7.5 per cent - while the country's growth target rate of 6.2 per cent would likely be missed.
Pakistani finance minister Asad Umar on Saturday warned the country was fast heading towards bankruptcy.
However, he promised to end the country's reliance on IMF bailouts to shore up its shaky economy, as officials prepared to negotiate a new loan.
An IMF team is set to arrive in Pakistan in early November to begin negotiations.