James T. Kirk/Starfleet career/USS Enterprise-A/Final mission

Kirk's career culminated in 2293, when the Enterprise-A was assigned to escort Klingon Chancellor Gorkon to Earth for a peace conference. Kirk opposed the peace initiative Spock covertly negotiated. He especially resented that Starfleet had chosen him to be the Federation's olive branch. A cabal of Federation and Klingon officials instigated an attack on Kronos One that appeared to come from the Enterprise-A, and assassinated Gorkon. 
The Klingons arrested Kirk and McCoy, then tried and convicted them for the murder of Gorkon, sentencing them to the Rura Penthe penal asteroid. In violation of orders and treaties, Spock took the Enterprise-A into Klingon space, eluded detection and rescued Kirk and McCoy. Following his victory over General at the Battle of Khitomer, Kirk saved the Federation president from assassination, and the historic Khitomer Conference continued; this led to the successful negotiation, signatures, and ratifications of "The First Khitomer Accords" between the UFP and the Klingon Empire.
Kirk, Spock, Scott, Uhura, Chekov, and McCoy see the rest of Sulu's crew onboard the on the view screen one last time before parting ways. Kirk ordered Chekov to set the course "second star to the right, and straight on till morning," as the last flight of the Enterprise-A. After that, she was decommissioned, and Kirk retired permanently from Starfleet. ()