Poland's ruling right-wing coalition fell apart on Tuesday after Prime Minister Mateusz Morawiecki dismissed the head of a junior coalition party, putting the government's future in doubt.

"My dismissal is de facto a rupture of the governing coalition," said Deputy Prime Minister Jaroslaw Gowin, head of the Agreement party.

Gowin and his Agreement party have been increasingly at odds with the main partner in the United Right coalition, the populist Law and Justice (PiS) party, in recent months.

Leader of small right wing party Agreement Jaroslaw Gowin has been dismissed from the ruling coalition
Leader of small right wing party Agreement Jaroslaw Gowin has been dismissed from the ruling coalition AFP / Wojtek RADWANSKI

But his departure does not mean that the government collapses automatically as there would need to be a formal vote of no confidence by parliament.

Gowin's party holds 10 seats in the 460-seat lower house of parliament and their departure would deprive the government of its majority and could force it to seek the support of the far-right.

If all his party's MPs follow Gowin, the United Right coalition, which includes one other junior partner, would control just 222 seats.

Protesters demonstrate in Warsaw on Tuesday in defence of media freedom
Protesters demonstrate in Warsaw on Tuesday in defence of media freedom AFP / JANEK SKARZYNSKI

But government spokesman Piotr Muller said: "I am not convinced that we will lose our majority.

"I am sure that there are people in the United Right and the rest of the Polish parliament who will support the beneficial reforms that we are proposing," he said.

The government's majority is set to be tested in a key vote on Wednesday on a new media law that has been one of the main bones of contention within the coalition.

Poland's Prime Minister Mateusz Morawiecki could be left leading a minority government
Poland's Prime Minister Mateusz Morawiecki could be left leading a minority government POOL / PASCAL ROSSIGNOL

Jacek Nizinkiewicz, a commentator for the Rzeczpospolita daily, said Gowin's dismissal was "a political earthquake" but "not surprising".

He said the PiS would try to persuade MPs from Gowin's party to continue supporting the government.

"Who will get scared and give in to pressure from PiS?" he asked.

Gowin, who complained that he found out about his dismissal from the media, said his party was leaving the government "with our heads held high".

He said he disagreed with the government over tax increases and a proposed law that could force the US group Discovery to sell off most of its stake in Poland's main private TV network TVN.

The law on TVN has raised fears about media pluralism in Poland, particularly after the takeover of regional media group Polska Press by the state-owned energy major PKN Orlen.

Thousands took to the streets in several demonstrations across Poland earlier on Tuesday to protest against the proposed law.

"There is something symbolic in the fact that my dismissal was announced at a moment when there are demonstrations everywhere in Poland against the law called the TVN law," Gowin told reporters.

"This law clearly violates the principle of media freedom," he said, adding that the change would "push us towards a confrontation with the United States, which is our most important ally from the point of view of defence".