Lockheed built 38 two-seat trainer versions of the F-104G Starfighter for the Royal Canadian Air Force. These aircraft were similar to the TF-104Gs built by Lockheed for other NATO allies, but were powered by Canadian-built J79-OEL-7 engines. They were given the Lockheed designation of Model 583-04-15, and were initially designated CF-113 in Canadian service. However, this designation was later changed to CF-104D. No CF-104Ds were built in Canada.
The first CF-104D made its maiden flight on June 14, 1961. The last 16 aircraft on the order had slightly different equipment and were designated CF-104D Mk. II. The CF-104Ds were initially given the serials 12631 through 12668, but on May 18, 1970 they were reserialed as 104631 through 104668.
In 1971-1973, seven former Canadian Forces CF-104Ds were transferred to Denmark after having brought up to TF-104G standards. In 1973, two other CF104Ds were transferred to Norway. Following their withdrawal from CAF service, six CF-104Ds were transferred to Turkey following an overhaul in Germany.
12631/12668 Lockheed CF-104D c/n 583A-5301/5338 reserialed 104631 through 104668 in 1970. 5302 (104632) to Norway in 1973 5303 (104633) to Norway in 1973 104636 to Turkey in 1986. 5307 (104637) to Norway in 1973 104638 to Turkey in 1986. 104642 to Turkey in 1986. 104650 to Turkey in 1986. 12654 to Denmark as RT-654, 1971-73 12655 to Denmark as RT-655, 1971-73 12657 to Denmark as RT-657, 1971-73 104658 to Turkey in 1986. 12660 to Denmark as RT-660, 1971-73 104661 to Turkey in 1986. 12662 to Denmark as RT-662, 1971-73 12664 to Denmark as RT-664, 1971-73 12667 to Denmark as RT-667, 1971-73