Direct reciprocity is one of the key mechanisms accounting for cooperation in our social life. According to recent understanding, most of the classical strategies for direct reciprocity fall into one of two classes, ‘partners’ or ‘rivals.’ A ‘partner’ is a generous strategy achieving mutual cooperation, and a ‘rival’ never lets the co-player become better off. They have different working conditions: For example, partners show good performance in a large population, whereas rivals do in head-to-head matches. Using exhaustive enumeration using a super-computer, we demonstrate the existence of strategies that are partners as well as rivals, called ‘friendly rivals.’ Among them, we focus on a human-interpretable strategy, named ‘CAPRI’ after its five characteristic ingredients, i.e., cooperate, accept, punish, recover, and defect otherwise. Our evolutionary simulation shows excellent performance of CAPRI regardless of environmental conditions.