In this paper, we study the performance of multiple-input multiple-output cognitive amplify-and-forward relay networks using orthogonal space–time block coding over independent Nakagami-m fading. It is assumed that both the direct transmission and the relaying transmission from the secondary transmitter to the secondary receiver are applicable. In order to process the received signals from these links, selection combining is adopted at the secondary receiver. To evaluate the system performance, an expression for the outage probability valid for an arbitrary number of transceiver antennas is presented. We also derive a tight approximation for the symbol error rate to quantify the error probability. In addition, the asymptotic performance in the high signal-to-noise ratio regime is investigated to render insights into the diversity behavior of the considered networks. To reveal the effect of network parameters on the system performance in terms of outage probability and symbol error rate, selected numerical results are presented. In particular, these results show that the performance of the system is enhanced when increasing the number of antennas at the transceivers of the secondary network. However, increasing the number of antennas at the primary receiver leads to a degradation in the secondary system performance.