The D7 class battle cruiser was a 23rd century warship that was originally designed by the Klingons that was also utilized by the Romulans during the late-2260s. The D7 class Klingon battle cruiser served as the backbone of the Klingon Imperial Fleet for several years during the 23rd century. (TOS: "Errand of Mercy" remastered, etc.)
By 2267, they were prominently featured in the Klingon-Federation Cold War, where they posed a serious threat to the security of Starfleet and the Federation. (TOS: "Elaan of Troyius"; TAS: "More Tribbles, More Troubles")
The Romulan Star Empire later began using the same the design by 2268. (TOS: "The Enterprise Incident")
According to the Star Trek Chronology the line regarding a Romulan-Klingon Alliance was added to TNG: "Reunion" to explain the Romulan use of D7s.
The K't'inga-class battle cruiser began to replace the D7 class during the 2270s. The D7 was finally "retired decades" prior to 2377. (Star Trek: The Motion Picture; VOY: "Prophecy")
Interest in these vessels by the Federation continued to appear well into the 2370s, as data on this class was commonly found within numerous Starfleet files. (TNG: "The Naked Now", "The Last Outpost", "Conspiracy"; VOY: "Drone", "The Voyager Conspiracy")