Norway has much to teach spendthrift nations such as the UK, its outgoing prime minister has said.

Jens Stoltenberg said indebted European nations should look to Norway, which has become one of the wealthiest countries in the world mainly by refusing to spend its huge oil revenues and placing them instead in a sovereign wealth fund.

"That way the fund lasts for ever," he said in a speech at Harvard University. "The problem in Europe with the deficits and the debt crisis is that many European countries have spent money they don't have. The problem in Norway is that we don't spend money we do have. That requires a kind of political courage."

Norway's sovereign wealth fund is the biggest in the world at £460bn. The fund generates money from its ownership of petroleum fields, taxes on oil and gas, and dividends from a 67% stake in Statoil, the country's largest energy company. Norway is the world's second-largest gas exporter and the seventh-largest oil exporter.

Stoltenberg, a Labour party member who served two consecutive four-year terms as prime minister, said his administration restricted itself to spending the investment gains made by the fund.

He said the fund was the main reason Norway sidestepped the "curse of oil" that has plagued many other resource-rich nations, particularly in the developing world.

"There are many, many other countries in the world that are in similar positions, that are facing the same kinds of challenges that we are facing: huge temporary income from natural resources," he said. "So, if there is a danger of an oil curse, Norway is really exposed to that danger. But we have managed to avoid it. The oil industry has been a blessing for Norway."

Maintaining the policy has not been pain-free for the nation. In 2009, the fund's value slumped in the wake of the Lehman Brothers crash. The loss of £56bn was equivalent to £11,000 per person. Since then, its investment strategy has widened its scope to include Asian assets, and property including a multimillion-pound purchase of shop leases on London's Regent Street.

Argument raged during the recent election over how much of the fund's revenues to invest. The far-right Progress party, which is expected to enter a coalition with the more mainstream Conservative party, wants to spend more of the fund on welfare to enable tax cuts. A broad consensus among politicians of all major parties that spending the oil funds would corrupt the nation and encourage young people to become dissolute means the proposal is unlikely to gain much traction.

Britain, too, had the luxury of significant oil and gas funds, but successive governments have faced criticism for frittering them away on maintaining inefficient industries rather than saving the money in a sovereign wealth fund. Britain became a net importer of oil in 2003 and has faced a worsening balance of payments deficit and decline in tax revenues as a result, without a wealth fund to soften the blow.