The book "Ender's Game," by Orson Scott Card, is set far into the future. Earth has been at war with an alien civilization with which it cannot effectively communicate.
As a result of their near destruction, leaders on Earth have set about trying to identify and develop superior military leaders and strategists to help them win their next fight with the aliens. Ender, after a series of experiences, begins to emerge as a brilliant military mind.
The book's climax is effectively rendered as the young Ender, told that he is taking part in a test of military leadership, actually fights a decisive battle with the alien race. Without realizing it at the time, he wins the battle no one else could win in the past and saves Earth.
However, the victory comes at a high price, as Ender causes the death of many soldiers and almost every one of the enemy. The story changes its tone as Ender sees the results of war. The book ends with Ender agreeing to help the alien race re-establish themselves on another world.