Despite collapsing oil prices in recent months, Exxon Mobil, the world’s largest publicly traded oil company, still managed to set a record for last year as the most profitable American corporation ever.

Exxon earned $45.2 billion in 2008, beating the record it set in 2007 for most profitable corporation, at $40.6 billion. That came despite a fourth quarter in which income fell 33 percent, owing to the steepest drop ever in oil prices, as the economy went into a tailspin.

After riding a tide of swelling earnings in recent years, the once high-flying oil sector is scrambling to adjust to a sharp downturn. Oil consumption is falling in all major developed nations as economies shrink and consumers cut back on spending.

As a result, oil prices have dropped more than 70 percent since peaking above $145 a barrel in July. On Friday, they traded at about $42 a barrel.