Okay: The sudden shift in mood toward the end of this first novel from the comic to the dramatic is rather disconcerting, and its ultimate resolution is not entirely persuasive. But who on earth could possibly care? "A Good Man in Africa" is a work of such sustained hilarity, inventiveness and high spirits that its author surely can be forgiven a minor lapse or two.

Indeed, for giving us his central character, Morgan Leafy, William Boyd should be granted an indulgence of a half-dozen minor lapses in each of his next five novels. Leafy, first secretary at the British Commission in the provincial capital of Nkongsamba, in the African country of Kinjanja, is a 34-year-old hedonist who is plagued, in approximately equal measure, by ravenous appetites on the one hand and punishment for indulging them on the other: "There were two good things about living in Africa, he told himself convivially: just two. Beer and sex. Sex and beer . . . They were as reliable as anything in this dreadful country, he thought, and, he reflected smugly, feeling more buoyant and pleased with himself all of a sudden, he was certainly getting enough of both."

Not enough: Too much. His consumption of beer and other alcoholic beverages--any alcoholic beverages--is so heroic that he packs, on a 5-foot, 9-inch frame, nearly 220 pounds, and he from time to time is entertained by memorable hangovers: "It seemed as if his entire body had been tenderized by one of those jagged wooden mallets used for bashing steaks. His tongue felt twice as large as normal, as though it was striving to loll out of the side of his mouth like a dog's, and he had a neuralgic headache that loosened every tooth in its socket and made his sinus passages hum like tuning forks."

As for the romantic side of things, Morgan has been victimized by his African mistress, Hazel, who in the course of their frolics has presented him with a dose of the clap. This proves terribly inconvenient when, in a moment of unexpected passion, he is set upon by the ravishing Priscilla Fanshawe, daughter of the commissioner and owner of a set of dauntingly firm breasts; in a moment of high honor, Morgan turns aside her panting onslaught lest he pass along to her his memento of pleasures elsewhere--and in so doing sufficiently offends her that she rushes into the arms of the newly arrived Dickie Dalmire, Morgan's subordinate.

This is but a part of what Morgan construes to be a cruel and dreadful farce, the central player in which is "Morgan SNAFU Leafy, R.I.P." Not merely is he hog-fat and horny, but he has been manipulated by the crafty Mrs. Fanshawe into playing "Father Christmas" for the coming holiday; he has been caught in yet another libidinous indiscretion by a prominent politician and is, as a direct result, being blackmailed by him; and he has been put in charge of disposing of the large, decomposing body of a woman whose manner of death has put the natives in fear for their lives.

Amid all these tribulations he is brought face to face, as it were, with a dry, matter-of-fact doctor named Murray whose unflappable competence and poise Morgan comes to detest with a burning, surging passion: " . . . he decided it must be something to do with the way that Murray implicitly set himself in judgment--as a sort of human rebuke, a living, breathing admonition to others . . . That was it, Morgan thought; when you met Murray all the shabby moral evasions that made up your life, all the gray zones of questionable behavior, the whole sad compendium of self-regarding acts suddenly stood up to be counted. But what was worse, what was particularly galling about Murray was that, having somehow brought this effect about, he didn't really seem to care any further, wasn't especially surprised to find out that there were so many."

Yet there is more to Murray than Morgan realizes, and by the end of the novel the doctor has taught him some essential lessons that he had theretofore managed to evade. It is a mark of Boyd's maturity and skill that he plays Morgan and Murray off against each other at first, then gradually and subtly alters the relationship so that each man becomes something more than, and different from, what the reader initially expected. Boyd understands the complexities of character and relationships to an unusual degree--especially for one who has yet to turn 30--and he makes the encounter between these two men one of genuine significance.

He is equally subtle in his depiction of the clash of African and European cultures. This is a familiar subject for English writers; from Kipling to Waugh to Greene, Boyd is up against some tough competition, but he holds his own admirably. Among the several points he makes about that clash, perhaps the central one has to do with the ignorance of the whites about the land from which they have extracted so much: "Kinjanja was a mystery to him, he realized; he knew next to nothing about the way its inhabitants' minds worked, the way its colonially imposed institutional superstructure related with the traditional tribal background; he knew nothing of the ethnic, racial and religious pressures surreptitiously influencing events." Boyd, who was born in Ghana and grew up in Nigeria, knows whereof he writes.

But the serious aspects of "A Good Man in Africa," though they indeed exist, take the back seat to its comedy. This is a wildly funny novel, rich in witty prose and raucous incidents. A picnic that Morgan and Priscilla take by a river is hilarious enough, but it is actually exceeded by a climactic scene in which the unexpected arrival of a poet named Greg Bilbow deliciously complicates an already outrageous situation. William Boyd knows exactly what he is doing and he pulls it off brilliantly; "A Good Man in Africa" is, without qualification, a delight