Google quickly found for me a discussion thread about what seems to be this very issue. That thread pointed to the Apple MacBook Battery Update page which indicates that I may be able to get a new battery out of this.
Meanwhile, I'm trying one of the other recommendations in that thread. The BatteryUpdater.bundle on my machine was at version 1.3. This may have been installed by the latest update; I have no way of telling. Anyway, I dragged it to the Trash, rebooted, emptied the trash, then ran System Update again which installed Battery Updater 1.2. I then switched to battery power for a while and sure enough, about half an hour later the machine spontaneously shut down. Finally, I reset the SMC and—cross fingers—I have been on battery for two hours without any shutdowns.
Update: After nearly three hours, my MacBook shut down again. I'm going to pursue the battery replacement route.