Pakistan sought help from the International Monetary Fund on Wednesday to avoid defaulting on billions of dollars in loans and to skirt a financial crisis brought on by high fuel prices, dwindling foreign investment and soaring militant violence. Pakistani officials had previously said that turning to the IMF would be a last resort. Aid from the monetary fund often comes with conditions, including cutting public spending, that can affect programs for the poor and that can be politically difficult for governments to accept. Dominique Strauss-Kahn, the fund's managing director, said in a statement that an IMF mission would begin discussions with Pakistani authorities in the next few days "on a program aimed at strengthening economic stability and enhancing confidence in the financial system." He said the amount of aid had not been determined. Mr. Strauss-Kahn said Pakistan had requested discussions with the fund "to meet the balance of payments difficulties the country is experiencing as a result of high food and fuel prices and the global financial crisis." Iceland, Hungary, Serbia and Ukraine have also turned to the IMF for aid to ease their financial problems. The monetary fund was created in 1944 to rebuild the world financial system after World War II, and it initially helped developed nations lend money to one another. By the 1990s, it had evolved into a rescue fund for troubled economies in developing nations, but it gave them little say on the terms of their loans. Pakistani economists say that up to $5 billion is needed to avoid defaulting on debt that is due for repayment next year, but that an additional $8 billion may be needed. The country has also asked for loans from wealthy nations and multilateral agencies like the World Bank.