It was not published until six years after his death, more than two years after World War 1 had started and while America was still 'neutral'. Although it was written in response to the US war on the Philippines I believe it applies equally to every war both before and afterwards.
I have attached an excerpt and would be interested in hearing how other people feel about it.
The War Prayer
by Mark Twain--- An aged stranger entered and moved with slow and noiseless step up the main aisle, his eyes fixed upon the minister, his long body clothed in a robe that reached to his feet, his head bare, his white hair descending in a frothy cataract to his shoulders, his seamy face unnaturally pale, pale even to ghastliness. With all eyes following him and wondering, he made his silent way; without pausing, he ascended to the preacher's side and stood there waiting. With shut lids the preacher, unconscious of his presence, continued with his moving prayer, and at last finished it with the words, uttered in fervent appeal, "Bless our arms, grant us the victory, O Lord our God, Father and Protector of our land and flag!"
The stranger touched his arm, motioned him to step aside -- which the startled minister did -- and took his place. During some moments he surveyed the spellbound audience with solemn eyes, in which burned an uncanny light; then in a deep voice he said:
"I come from the Throne -- bearing a message from Almighty God!" The words smote the house with a shock; if the stranger perceived it he gave no attention. "He has heard the prayer of His servant your shepherd, and will grant it if such shall be your desire after I, His messenger, shall have explained to you its import -- that is to say, its full import. For it is like unto many of the prayers of men, in that it asks for more than he who utters it is aware of -- except he pause and think.
"God's servant and yours has prayed his prayer. Has he paused and taken thought? Is it one prayer? No, it is two -- one uttered, the other not. Both have reached the ear of Him Who heareth all supplications, the spoken and the unspoken. Ponder this -- keep it in mind. If you would beseech a blessing upon yourself, beware! lest without intent you invoke a curse upon a neighbor at the same time. If you pray for the blessing of rain upon your crop which needs it, by that act you are possibly praying for a curse upon some neighbor's crop which may not need rain and can be injured by it.
"You have heard your servant's prayer -- the uttered part of it. I am commissioned of God to put into words the other part of it -- that part which the pastor -- and also you in your hearts -- fervently prayed silently. And ignorantly and unthinkingly? God grant that it was so! You heard these words: 'Grant us the victory, O Lord our God!' That is sufficient. the *whole* of the uttered prayer is compact into those pregnant words. Elaborations were not necessary. When you have prayed for victory you have prayed for many unmentioned results which follow victory--*must* follow it, cannot help but follow it. Upon the listening spirit of God fell also the unspoken part of the prayer. He commandeth me to put it into words. Listen!
"O Lord our Father, our young patriots, idols of our hearts, go forth to battle -- be Thou near them! With them -- in spirit -- we also go forth from the sweet peace of our beloved firesides to smite the foe. O Lord our God, help us to tear their soldiers to bloody shreds with our shells; help us to cover their smiling fields with the pale forms of their patriot dead; help us to drown the thunder of the guns with the shrieks of their wounded, writhing in pain; help us to lay waste their humble homes with a hurricane of fire; help us to wring the hearts of their unoffending widows with unavailing grief; help us to turn them out roofless with little children to wander unfriended the wastes of their desolated land in rags and hunger and thirst, sports of the sun flames of summer and the icy winds of winter, broken in spirit, worn with travail, imploring Thee for the refuge of the grave and denied it -- for our sakes who adore Thee, Lord, blast their hopes, blight their lives, protract their bitter pilgrimage, make heavy their steps, water their way with their tears, stain the white snow with the blood of their wounded feet! We ask it, in the spirit of love, of Him Who is the Source of Love, and Who is the ever-faithful refuge and friend of all that are sore beset and seek His aid with humble and contrite hearts. Amen.
(*After a pause.*) "Ye have prayed it; if ye still desire it, speak! The messenger of the Most High waits!"
It was believed afterward that the man was a lunatic, because there was no sense in what he said.