In this paper, we tackle a generic optimal regime switching problem where the decision making process is not the same from a regime to another. Precisely, we consider a simple model of optimal switching from competition to cooperation. To this end, we solve a twostage optimal control problem. In the first stage, two players engage in a dynamic game with a common state variable and one control for each player. We solve for open-loop strategies with a linear state equation and linear-quadratic payoffs. More importantly, the players may also consider the possibility to switch at finite time to a cooperative regime with the associated joint optimization of the sum of the individual payoffs. Using theoretical analysis and numerical exercises, we study the optimal switching strategy from competition to cooperation. We also discuss the reverse switching.