The 2-1 ruling was issued in a case involving a Wisconsin anti-abortion group that challenged congressional restrictions on ads by corporations, labor unions and other special interest groups that mention candidates two months before a general election.
Some lawmakers have predicted such a ruling would create a loophole in the 2002 McCain-Feingold campaign law, which attempted to reduce the influence of big-spending special-interest groups in elections.
The case automatically heads to the Supreme Court for review.
The three-judge panel upheld the government's right to prohibit corporate and union-sponsored advertisements that attempt to influence voters, but said organizations have a First Amendment right to speak out on genuine political issues.
Wisconsin Right to Life has been fighting the law since 2004, when it sought to run an advertisement urging voters to contact Wisconsin Sens. Russ Feingold and Herb Kohl, both Democrats, and ask them not to hold up President Bush's judicial nominees.
With Feingold running for re-election in 2004, the ad was prohibited. Wisconsin Right to Life argued that it wasn't trying to influence an election and said the law restricted its constitutional right to petition the government.
The judges said Thursday that the Wisconsin advertisements were genuinely addressing policy, not the election, and thus were constitutionally protected speech.
The three-judge panel was divided 2-1, with U.S. District Judge Richard Leon and U.S. Court of Appeals Judge David B. Sentelle issuing the majority opinion. U.S. District Judge Richard W. Roberts dissented.