British Prime Minister Tony Blair lost a crucial parliamentary vote Wednesday on sweeping new legislation allowing police to detain terrorism suspects for 90 days without charge — the first major defeat of his premiership and a serious blow to his authority.

Lawmakers blocked the measure by 322 votes to 291, a majority of 31 against the government. Blair, who had put his authority in the line, appeared tense and shook his head as the result was read out.

Rebels in Blair's Labour Party and opposition lawmakers instead voted for a maximum detention period of 28 days — by 323 votes to 290.

The Terrorism Bill was drafted in the wake of the July attacks on London's transit system. Designed to tackle Muslim extremism, it also aims to outlaw training in terrorist camps, encouraging acts of violence and glorifying terrorism.

It must be approved by Parliament's upper chamber, the House of Lords, before it can become law.

Wednesday's result is humiliating for Blair, who took a major political gamble in refusing to back down on the plan and had called in every supporter to shore up numbers. Treasury chief Gordon Brown was called back from an official visit to Israel, only two hours after arriving in the country.

Blair also ordered Foreign Secretary Jack Straw to cut short an official EU visit to Russia, while Labour Party chairman Ian McCartney, who is recuperating from heart surgery, volunteered to return to work for the vote.

The current maximum detention period for terror suspects without charge is 14 days and critics argued that extending it to 90 days would erode civil rights.

The result raises serious question about Blair's grip on power. His popularity slumped due to the unpopular war in Iraq, and some Labour lawmakers now regard Blair as an electoral liability.

Blair has said he will not seek a fourth term in office, and although he could serve as prime minister until 2010, there is pressure for him to quit sooner.

Left-wingers in the party have long been unhappy with his plans for greater private sector involvement in state-run hospitals and schools. Many want Blair to step aside in favor of Brown, a powerful and popular figure in the party.