WARSAW — Poland’s president signed sweeping legislation on Wednesday to overhaul the country’s judicial system, a move critics say fundamentally undermines the rule of law in a nation that only three decades ago broke free from the yoke of the Soviet Union to embrace democracy.

The new laws effectively put the Polish courts under the control of the right-wing governing party, Law and Justice. In signing them, President Andrzej Duda defied a formal warning delivered only hours earlier by the European Union, which called the legislation a “serious breach” of bedrock values like the rule of law.

Once viewed as a symbol for the successful integration of former Eastern Bloc countries into the West, Poland is now seen as portending a far darker trend — a turn toward right-wing populism and away from values like pluralism and respect for dissent.

The turn has underscored an emerging rift on the Continent between countries in the West like France and Germany, where the political establishment has rallied around core democratic values, and countries in the East like Poland and Hungary, where populist leaders have succeeded by appealing to the old gods of nation, faith and family.