Were you surprised by the ending of "The Sniper"?
The surprise ending of Liam O'Flaherty's short story "The Sniper" is meant to shock the reader and highlight the brutality of war, especially a civil war that matched countrymen against each other. At the end of the story, the Republican sniper deceives his Free State adversary into revealing himself and the Republican kills him, as he does two other enemies. When the sniper examines the body he discovers that he has killed his own brother.
O'Flaherty's purpose is to not only shock but also play on the sympathy of the reader and make the point that there are no real victors in a war which pitted brother against brother. Immediately after killing the opposition sniper, and before knowing who he was, the sniper is overcome with regret over the killing and the war itself. For the sniper, the war ends up being a tragedy affecting not only his family but also his mental stability.
If the reader knows the background of the story and the Irish Civil War, the ending may not come as that much of a surprise. Not long before the battle described in the story, the Irish Republican Army had split over the Anglo-Irish Treaty which was negotiated by the Provisional Government and made Ireland a free state within the British Commonwealth. Some members of the army bitterly disagreed with the treaty. They wanted Ireland to have total sovereignty. It became a matter of principle for the men of the army. Some broke away, and became known as Free Staters, and some remained Republicans. The brothers probably served together before the split, and so it is not that startling that they should be set against each other on the rooftops of Dublin in the summer of 1922.