[youtube http://youtu.be/jJsZCpp8hR4?] [youtube http://youtu.be/PsoJ-WJZGXM?]

Twain apparently dictated it around 1904-05; it was rejected by his publisher, and was found after his death among his unpublished manuscripts. It was first published in 1923 in Albert Bigelow Paine’s anthology, Europe and Elsewhere.
The story is in response to a particular war, namely the Philippine-American War of 1899-1902, which Twain opposed. See Jim Zwick’s page “Mark Twain on the Philippines” for more of Twain’s writings on the subject.