(covers information from several alternate timelines)
Human-Klingon history is riddled with conflicts between the United Earth/United Federation of Planets and Klingon Empire dating back to the mid-22nd century, following first contact during the Broken Bow Incident and prior to the creation of the Federation. These conflicts were generally considered as "annoyances" by the Empire. (ENT: "Broken Bow", "Judgment") With the Battle of the Binary Stars in 2256, open warfare broke out between the two star nations for the first, and not the last, time. (DIS: "The Vulcan Hello")
The Federation-Klingon Cold War escalated around 2223 and lasted almost seventy years. (Star Trek VI: The Undiscovered Country) Key disputed regions included Sherman's Planet, Organia, Donatu V, Neural, Capella IV, the Archanis sector, and the Tellun system. (TOS: "The Trouble with Tribbles", "Errand of Mercy", "A Private Little War", "Friday's Child", "Elaan of Troyius"; DS9: "Broken Link")
The tensions continued when the Klingons issued an ultimatum to the Federation, telling them to withdraw from the disputed area. The Federation responded with a blockade of the Klingon territory. The Klingons, believing themselves to be stronger, responded by invading Federation territories. (TOS: "Errand of Mercy")
The Klingon-Federation War of 2267
In 2267, relations with the Klingons began to break down and the Federation had to prepare for all-out war. They suspected a surprise attack was coming. The fleet was on alert, including the USS Enterprise, which was given secret orders. They read the orders at the appointed time and place, and then proceeded to secure Organia, a key planet between Federation and Klingon space, at any cost, per their instructions. Captain Kirk was authorized to break the Prime Directive on this occasion. While Klingon troops briefly occupied the planet, both the Federation and the Klingon Empire were stunned when the inhabitants of Organia revealed themselves to be advanced non-corporeal beings who forced an end to the short-lived war. (TOS: "Errand of Mercy")
An uneasy peace
In 2267, Starfleet Command gave an order to Captain Kirk to make a contract on topaline ore mining with Akaar, a teer of the ten tribes of Capella IV. Capellans were centuries behind the Federation, but Starfleet needed topaline for life support systems in some colonies. Unfortunately, Klingon delegate Kras came before them and was also aiming to make a contract with Capellans. Kras made an alliance with Maab, who had an interest to become a teer. Maab challenged Akaar to a fight to the death and won. Kirk, Spock and McCoy were put into prison, along with Akaar's widow Eleen, who was carrying his child. Klingons tricked the crew of the USS Enterprise by sending a false emergency signal sent by SS Dierdre.
While the Enterprise was out, the prisoners escaped to the mountains. Since they knew that the Capellans would eventually find them, Eleen stepped in front of Maab and told him that Kirk, Spock, and McCoy were dead. Kras didn't believe her and touched her in anger. This was a violation of Capellan law, so he was killed. After that, Kirk, Spock, and McCoy revealed themselves with newborn Leonard James Akaar, who would become a teer when he grew up. Until then, Eleen would be the regent of the ten tribes of Capella. (TOS: "Friday's Child")
The acquisition of Sherman's Planet was dependent on the grain quadrotriticale. The Organian Peace Treaty stated that whoever could show that they could develop the planet most effectively would get the planet. In 2268, the Klingons tried to sabotage the delivery of the grain by poisoning it, but a creature known as a tribble helped foil that plot. The Klingon Captain Koloth demanded an apology for the persecution of Klingon nationals in that quadrant, but again the tribble helped the Federation by revealing Arne Darvin as a Klingon spy. Thus, the Federation acquired possession of Sherman's Planet. (TOS: "The Trouble with Tribbles"; DS9: "Trials and Tribble-ations")
In 2268, the crew of the USS Enterprise went on a mission of exploration to the planet Neural. A previous mission on Neural was conducted thirteen years prior and was the first established contact with the natives of Neural. Young Lieutenant James Kirk was on that mission and became friends with a young native called Tyree. The Neural natives were a primitive society, twelve centuries behind the development of any technology. The Enterprise survey team was surprised when they discovered that some of the natives were in possession of flintlock firearms, a technology far beyond of their level of development. The team soon discovered that Klingons visited Neural in 2267 and gave the armament to some groups of natives, masking it to appear that the natives had developed that technology on their own. Kirk decided to violate the Prime Directive in order to prevent a situation in which the natives would be drawn into the Klingon sphere of influence. They also armed other factions (in one of which was Kirk's old friend Tyree) with flintlock arms, thereby creating a balance of power.
The Tellun system
In 2268, a disputed Klingon-Federation border area included the Tellun system. The civilizations of two inhabited worlds within, Elas and Troyius, were struggling to end a long interplanetary war. The United Federation of Planets and The Klingon Empire made their own claims to the system.
The Federation considered the Tellun system to be under its control, and established a friendly diplomatic relationship with the Government of Troyius. The arranged marriage of Elaan, the Dohlman of Elas, to the ruler of Troyius, brought some promise of peaceful coexistence to the Tellun worlds. Starfleet encouraged the effort by dispatching The USS Enterprise to convey Elaan to her wedding ceremony on Troyius. Troyian Ambassador Petri quoted Federation officials as saying, "failure of this mission would be as catastrophic for Federation planning as it would be for our two planets."
The Klingon Empire had its own interests in the system, and claimed that it fell under their jurisdiction. The Klingons, who had a shortage in dilithium and other resources due to there being "poor planets in the Klingon systems", had discovered that a very large amount of dilithium ore was on Elas, a fact unknown to the Federation. As the royal wedding approached, the Klingons found an ally in Kryton, an Elasian noble who loved Elaan and sought to prevent her marriage.
Enterprise departed on her sub-light journey to Troyius, shadowed by a D7-class battle cruiser. Kryton, on board as part of the Dohlman's guard, sabotaged the Enterprise's engines, causing the dilithium crystal converter assembly to fuse. A jump to warp speed would have triggered the starship's explosion, imperiling the local peace without requiring the Klingons to fire a shot against the Federation. But the nature of the damage was understood in time.
Limited to impulse engines, Enterprise was forced to "wallow like a garbage scow" while the battle cruiser danced around her at warp speeds. After Kirk's refusal to surrender, the Klingon ship began an assault in earnest. Kirk maneuvered as best he could, trying to keep his weakest shields away from the enemy while the Klingon disruptors pounded the Enterprise. Kirk's defensive posture, and the timely discovery of dilithium crystals in Elaan's radan necklace, allowed Enterprise to hang in the fight long enough for her crew to restore some warp power. After luring the Klingon ship closer, Enterprise jumped away to warp, pivoted, and unleashed a salvo of photon torpedoes.
Klingon relations with the Federation continued to periodically flare up throughout the latter half of the 23rd century. In one such occasion, Captains Kang and Kor together led two divisions of warships in an ancient Earth cavalry-style attack on the Federation outpost on Caleb IV. During the attack, Kang and Kor successfully tricked their opponents by launching first a small initial attack, and then striking with the bulk of the forces when the Federation began repair efforts. (DS9: "Once More Unto the Breach")
In the mid-2280s there was a short-lived peace, negotiated in the Galactic conference. This peace, however, was jeopardized following the Klingons' misinterpretation of the Federation-created Genesis Device. (Star Trek III: The Search for Spock) This included the bounty placed on the head of James Kirk. (Star Trek IV: The Voyage Home; Star Trek V: The Final Frontier)
In 2289, Koloth represented the Klingon Empire in the negotiations at the Korvat colony with the Federation, who was represented by their top ambassador, Curzon Dax. Although Dax offered Koloth several reasonable proposals, many of which favored the Klingon Empire, Koloth was never satisfied. (DS9: "Blood Oath")
Negotiations remained in limbo until 2293, when the Klingon moon Praxis exploded, jeopardizing the Klingon homeworld. This caused the Klingon Chancellor Gorkon to call for a new peace between the two powers, including the abolishing of the Klingon Neutral Zone. (Star Trek VI: The Undiscovered Country)
In 2344, the Battle of Narendra III had a decisive influence on interstellar history. Having been betrayed by the Romulan Star Empire, and witnessing the courage of the USS Enterprise-C, this event had the effect of finally ending Romulan-Klingon relations and solidifying Federation-Klingon relations. (TNG: "Yesterday's Enterprise")
In 2372, Gowron withdrew the Klingon Empire from the Khitomer Accords in response to the Federation Council's condemnation of his invasion of the Cardassian Union. (DS9: "The Way of the Warrior") This sparked a new Federation-Klingon War from late 2372 to mid-2373. Though relatively brief, the conflict was costly to both sides.