In what the French government denounced as a “sad comedy,” lawmakers on Thursday rejected President Nicolas Sarkozy’s plan to bolster the movie and music industries by cutting off the Internet connections of persistent copyright pirates.

The surprise outcome delayed, but may not kill, the most far-reaching initiative by any government in the battle against unauthorized file-sharing. It is also a major embarrassment for Mr. Sarkozy, who has rallied sufficient legislative support for other measures popular with French media companies, like phasing out advertising on public television.

Until Thursday afternoon, the anti-piracy plan appeared on track for passage in the National Assembly, after having been approved by the other house of Parliament, the Senate. A committee of members of both chambers had worked out differences this week.

But the measure, while supported by many members of the French cultural establishment, had always been unpopular with ordinary voters. File-sharing is widespread in France, where legitimate online services like Apple’s iTunes music store have never caught on to the extent that they have in the United States.