VERSAILLES, France — French lawmakers voted Monday in favor of a sweeping revision of France's constitution — but by a one-vote margin that highlights the controversy behind the vote.

The changes give parliament greater power but also add privilege to the presidency.

The reform was a political hot potato for President Nicolas Sarkozy, but the thin win — 539 votes for and 357 against — saved him from humiliation. That is one vote more than the 538 needed to pass the changes.

The vote by both houses of parliament was held in a special session at the Chateau of Versailles.

Sarkozy's conservative party pressed for the reform right up until the vote.

The bill allows the president to speak before parliament for the first time, but it also limits the president to two five-year terms and expands parliament's powers by allowing it to veto major presidential appointments and reduce the government's abilities to push through legislation.

The presidency will also be required to inform parliament of any troop deployment overseas, and to win parliamentary authorization for any such deployment lasting more than four months. France currently has troops in countries from Afghanistan to Congo.

It also gives citizens a larger voice, creating, among other things, the post of an independent "citizens' rights defender." Any citizen who feels wronged by the French administration could appeal to this defender.

Sarkozy introduced the reform idea a year ago and has taken a personal interest in recent days in trying to keep his governing majority together to support the bill.