Polish President Andrzej Duda has vetoed a controversial media ownership law that critics said was intended to silence a US-owned TV station critical of the government, BBC reported. The law would have prevented companies from outside the European Economic Area from controlling Polish media outlets. If passed, the US-based Discovery group would have had to sell its stake in the news network, TVN24. Officials argued the law intended to limit the influence of hostile states. The ruling Law and Justice Party (PiS) has long said foreign corporations hold too much power over Polish media and rushed the bill through parliament earlier this month. But critics said the move was intended to attack TVN24, Poland's most watched news channel and a network whose reporters have often been critical of the conservative government. TVN24's parent, TVN, is owned by Discovery via a Dutch-based company to get around an existing ban on non-European firms owning more than 49% of Polish media companies. President Duda, who is strongly supported by PiS, said he appreciated the government's attempt to protect the country from potentially hostile actors such as Russia, but noted that the bill raised significant concerns over property rights. He added that it could not be made to apply retrospectively to existing business arrangements and investment treaties. "The bill and its amendments concern entities which are already present in the market," Duda said. "There is also the issue of media pluralism, of freedom of speech. When taking my decision, I took this element into serious consideration." Thousands of Poles protested earlier this month outside the presidential palace in Warsaw against the law, with many in the crowd waving EU flags and holding signs emblazoned with the TVN24 logo. Former EU chief Donald Tusk, who now leads the opposition Civic Platform party, said Duda's decision proved that "pressure makes sense". And the chief US diplomat in Warsaw, Chargé d'affaires Bix Aliu, tweeted his thanks to Duda and praised him for "his leadership and commitment to common democratic values and for protecting the investment climate in Poland". "Together, the allies are stronger," Aliu said. Earlier this month, US state department spokesperson Ned Price called on the government to think carefully before moving forward with a law that could "erode foreign investors' confidence in their property rights and the sanctity of contracts in Poland". And EU Commission Vice-President Vera Jourova had pledged that the bloc would take action against any law that failed to comply with EU law.