The Guns of the South by Harry Turtledove. An alternate history of the American Civil War.

"January 1864 - General Robert E. Lee faces defeat. The Army of Northern Virginia is ragged and ill-equipped. Gettysburg has broken the back of the Confederacy and decimated its manpower.
Then Andries Rhoodie, a strange man with an unplaceable accent, approaches Lee with an extraordinary offer. Rhoodie demonstrates an amazing rifle: its rate of fire is incredible, its lethal efficiency breathtaking - and Rhoodie guarantees unlimited quantities to the Confederates.
The name of the weapon is the AK-47..."
(from the Back Cover of the paperback version)

The cover of the paperback version displays General Lee holding an AK-47 with both hands (a feature which has started more than a few conversations with confused passers-by).

The novel follows the exploits of two central characters, that of Robert E. Lee, as well as a First Sergeant Nate Caudell of the 47th North Carolina, part of the Army of Northern Virginia (he is also an educated school teacher, so he is quite intelligent). Both characters are both easy and difficult to relate to; both of them have reservations about slavery, but are both patriotic Confederates. Their tales intertwine as they go forth and win the Civil War, and then grapple with a very different postwar aftermath.

While Caudell was little more than a name on a unit roster to Turtledove before he went to flesh him out, Lee was a famous and established persona, which certainly was difficult to write properly. Turtledove, however, did an excellent job at portraying Lee realistically and in accordance with much of what we know of him. Some liberties were taken (especially with one of Lee's turnabouts in opinion), however.
Though he is writing about history (or alternate history!), Turtledove keeps everything fresh and exciting. There is no drolling, mechanical recitations of battles, but rather lively, vivid, and disturbing descriptions of the conflicts. For instance...

"The new Federal attacking column marched up the Brock Road in perfect order, filling the roadway from edge to edge, each bluecoat a regulation thirteen inches from the man on either side of him. The Yankees hesitated when they saw ahead of them the ruins of the two regiments that had gone in before them; a few men in the first ranks took half steps instead of full marching paces. But shouts and curses from officers and sergeants quickly got their lines dressed once more, and they bore down on the breastwork with a hurrah.
The Confederates broke them. Mollie Bean had the right of it, Caudell thought as he fired again and again - using repeatsers against such a bunched target was murder. But he had been right, too, for it was neccessary murder if he was to live himself. The Northerners went down like ninepins. But more and more pushed forward to take their places until, at last, they would advance into the face of death no more, but turned and ran for the rear."
(The Guns of the South, p.127)

I cannot recommend this book highly enough. Whether you be a sci-fi fan, or a History Channel watcher, or a student of American History... or if you've ever imagined what some ancient general might have done with an army of men equipped with automatic weapons... this book should be read. Not only for the sheer, guilty pleasure of such a fantastic situation, but because Turtledove knows his stuff, and truly does teach you about what the world was like in 1864.