The Federation-Klingon War of 2267 was a conflict fought between the United Federation of Planets and the Klingon Empire in 2267. It was the result of years of tense build-up in a cold war situation, but was ultimately inconclusive because the fighting was abruptly ended by the Organians. (TOS: "Errand of Mercy")
Shortly before stardate 3198.4, ongoing negotiations between the two sides were in danger of breaking down, and open warfare was becoming an unwelcome likelihood. Starfleet Command expected that the Klingons would launch a surprise attack after they issued an ultimatum demanding that the Federation withdraw from all disputed regions along their mutual border, including Donatu V, Sherman's Planet, Organia, the Archanis sector, and other territories. When the Federation refused the demands, the Klingons launched an immediate attack – even before an official declaration of war was issued. (TOS: "The Trouble with Tribbles")
When the Federation starship USS Enterprise received notice of the declaration of war, it was ordered to the planet Organia, which occupied a strategic location in disputed space (now the front lines of the war). Captain Kirk's orders were to prevent the Klingons from occupying the planet and using it as a forward base. At the time, the Organians were believed to be a simple, pre-warp agrarian society. Kirk and his first officer Spock beamed down and offered the Organian Council of Elders assistance in defending against the impending Klingon attack; perplexingly, the Organians refused.
Mere minutes later, the Klingons invaded, forcing the Enterprise away from the planet and leaving Kirk and Spock stranded on the surface. Klingon commander Kor proclaimed the planet a new territory of the Klingon Empire, with himself as military governor. Kirk and Spock disguised themselves as Organians to blend in and avoid capture; ironically, Kor selected Kirk (alias Baroner) as his liaison to the Organian population, unaware that he was dealing with the enemy.
Kirk and Spock attempted to wage a heroic two-man guerrilla war against the Klingons in an attempt to both disrupt enemy operations and to inspire the Organians to rebel against their Klingon occupiers. However, to prevent violence, council leader Ayelborne turned Kirk and Spock over to Kor, revealing their true identities. Kirk and Spock were imprisoned, but a short time later Ayelborne helped them escape, claiming that he had to protect their safety. Ayelborne was vague on how he penetrated the Klingon stronghold and evaded the guards there.
When Kirk and Spock attempted to invade Kor's headquarters to hold the commander hostage, Kor welcomed Kirk, and Spock letting them know that the Federation fleet was on its way and that the Klingon fleet was going to meet them. Kor said the battle would decide the outcome of the Galaxy for the next 10,000 years, and assured both men that the Klingons would win the battle, but Spock countered that Kor couldn't predict the outcome of the battle and that there were many possibilities. Just then Klingon Soldiers appeared to rescue Kor, while at the same time the Enterprise returned with the Federation fleet, and were about to engage the Klingons in battle when the Organians, not wanting anymore violence, revealed themselves to be extremely advanced noncorporeal beings. They altered the perceptions of all Federation and Klingon ships, and soldiers, making it seem as if weapons and instruments of war were suddenly too hot to touch. In this way, they brought about an abrupt end to the war. Ayelborne appeared to both the Federation Council and the Klingon High Council and announced the unilateral imposition of the Treaty of Organia, which established ground rules for further interaction between the two powers, and for the resolution of the territorial disputes.
Ayelborne also predicted that the Klingons and the Federation would one day become fast friends – a prospect scoffed at by Kirk and Kor, but one that ultimately proved true. (TOS: "Errand of Mercy"; Star Trek VI: The Undiscovered Country)