Sahih Muslim, Book 021, Number 4756:
Jabir reported: Allah's Messenger (may peace he upon him) sent us (on an expedition) and appointed Abu 'Ubaida our chief that we might intercept a caravan of the Quraish and provided us with a bag of dates. And he found for us nothing besides it. Abu Ubaida gave each of us one date (everyday). I (Abu Zubair, one of the narrators) said: "What did you do with that?" He said: "We sucked that just as a baby sucks and then drank water over that, and it sufficed us for the day until night. We beat off leaves with the help of our staffs, then drenched them with water and ate them. We then went to the coast of the sea, and there rose before us on the coast of the sea something like a big mound. We came near that and we found that it was a beast, called al-'Anbar (spermaceti whale). Abu 'Ubaida said, 'It is dead.' He then said: 'No (but it does not matter), we have been sent by the Messenger of Allah (may peace be upon him) in the path of Allah and you are hard pressed (on account of the scarcity of food), so you eat that.' We three hundred in number stayed there for a month, until we grew bulky. He (Jabir) said: 'I saw how we extracted pitcher after pitcher full of fat from the cavity of its eye, and sliced from it compact piece of meat equal to a bull or like a bull.' Abu 'Ubaida called forth thirteen men from us and he made them sit in the cavity of its eye, and he took hold of one of the ribs of its chest and made it stand and then saddled the biggest of the camels we had with us and it passed under it (the arched rib), and we provided ourselves with pieces of boiled meat (especially for use in our journey). When we came back to Medina, we went to Allah's Messenger (may peace be upon him) and made a mention of that to him, whereupon he said: 'That was a provision which Allah had brought forth for you. Is there any piece of meat (left) with you, so that you give to us that?' He (Jabir) said: 'We sent to Allah's Messenger (may peace be upon him) some of that (a piece of meat) and he ate it.'"
Update: After I posted this hadith last night, it occurred to me that the story might appear in The Sealed Nectar. It is, on p. 289:
The invasion of Al-Khabat took place in the eighth year of Al-Hijra, i.e., before Al-Hudaibiyah Treaty. Abu 'Ubaidah bin Al-Jarrah led three hundred horsemen to observe a caravan belonging to Quraish.
Because of the lack of food supplies, they began to starve so much that they had to eat Khabat (leaves of trees), hence the appellation "The Army of Al-Khabat." One of the men slaughtered nine camels on three occasions, three each time at different stages of the mission. Abu 'Ubaidah, the leader of the campaign prohibited him from doing so. The sea presented them with a whale rich in fat and they subsisted on it for half a month.
When they came back home, they narrated the story to the Prophet (pbuh), who commented that it was provision granted by Allah (swt), and asked them to share [with] him some of its meat.
Chronologically this occurred before the Treaty of Al-Hudaibiyah, after which the Muslims stopped intercepting Quraishi caravans.
The whale in question is most likely that of a sperm whale, which is known for its large quantities (up to three tons) of spermaceti, a white, semi-liquid, waxy substance that is found in the sperm whale's head.