Constitutionally, the president cannot remove the prime minister, but he actually can. "The womb that spawned that thing is fertile yet"
Anyway, my understanding is that it is NOT limited to when they are from the same party. "The womb that spawned that thing is fertile yet"