BERLIN — Germany’s highest court dismissed complaints on Thursday from opponents of a trade deal between Canada and the European Union, a legal effort that had the potential not only to torpedo the pact but also to imperil for a proposed agreement between Europe and the United States.

The ruling from the Federal Constitutional Court, though directly related to the Canadian trade deal, also affects negotiations for the Trans-Atlantic Trade and Investment Partnership, or T.T.I.P. Aimed at creating the world’s largest trading zone, T.T.I.P. faces stiff headwinds in Europe and the United States after years of negotiations.

The ruling on Thursday concerned a series of complaints against the Comprehensive Economic and Trade Agreement, known as CETA.

Those who filed the complaints wanted the German government to be legally required to vote against CETA at a European Union meeting next week. That would give the court time to consider allegations that the pact violated the principles of democracy.