Poland‘s parliament has voted in favor of a bill that prevents non-European owners from having controlling stakes in Polish media companies

The bill, if given a nod by the Polish president, is widely viewed as a blow to media independence in Poland.

The legislation would force Discovery Inc, the US broadcaster that is the owner of Poland’s largest private television network, TVN, to sell its Polish holdings, according to Associated Press inputs.

The legislation is seen as a major attack on media independence in a European Union nation that has already been criticized for reducing media diversity and judicial independence.

The vote was earlier postponed unexpectedly much to the surprise of opposition lawmakers, who rejoiced and said there was still hope to preserve media independence.

But later the speaker of parliament, Elzbieta Witek, resumed the session and said there would be an attempt to vote after all. Opposition lawmakers accused her of breaking parliamentary rules by allowing the vote to take place after agreeing to postpone it until September.

The fact that Law and Justice, the ruling party, failed to prevent the postponement was seen as a sign that it did not have the support to pass the media bill. But Polish media reported that some lawmakers had accidentally voted the wrong way, or were being offered perks to support the ruling party, according to AP reports.

The development in parliament follows two days of political upheaval that saw the prime minister on Tuesday fire a deputy prime minister who opposed the media bill. That minister, Jaroslaw Gowin, heads a small coalition partner with 13 seats in the 460-seat lower house that formally left the ruling coalition on Wednesday.

The ruling party has long sought to nationalize media in foreign hands, arguing it is necessary for national security. Ejecting TVN’s American owner from Poland’s media market would be a huge victory for the government, coming after the state oil company last year bought a large private media group, the Associated Press report said.

Its political opponents, however, believe that TVN’s independence is tantamount to saving media freedom and see nothing less than the survival of Poland’s democracy as being on the line.

TVN’s all-news station TVN24 is a key source of news for many Poles but it is also a thorn in the government’s side. It is often critical and exposes wrongdoing by officials. The government’s supporters consider it biased and unfairly critical.