British Prime Minister Tony Blair (search) made a surprise visit to Iraq on Sunday, declaring the occupation is at a critical stage with just six months to restore order ahead of the return to self-rule. His top envoy warned that insurgents are growing more sophisticated and planning bigger attacks.

Blair, visiting southern Iraq, said security in Iraq would be monitored closely as the U.S.-led coalition prepares to transfer authority to a transitional Iraqi government by July 1.

"The important thing is to realize we are about to enter into a very critical six months," the prime minister said on his flight home. "We have got to get on top of the security situation properly and we have got to manage the transition. Both of those things are going to be difficult."

Blair's senior diplomat in Iraq, Sir Jeremy Greenstock (search), earlier underscored the challenge facing coalition forces.

"The opposition is getting more sophisticated, using bigger bombs and more sophisticated controls," Greenstock said. "We will go on seeing bigger bangs."

On New Year's Eve, a 500-pound car bomb killed eight people celebrating in an upscale restaurant in Baghdad, the capital. On Dec. 27, coordinated strikes struck the southern city of Karbala (search), killing 19 people, including seven coalition troops, and wounding some 170.

Fighters loyal to deposed Iraqi leader Saddam Hussein are behind 75-80 percent of the attacks while foreign terror groups, using a cell structure, are responsible for the rest, Greenstock said.

Blair, a staunch ally of the United States whose popularity plummeted at home amid allegations his government overstated the threat posed by Saddam, defended the Iraq invasion.

"This conflict here was a conflict of enormous importance because Iraq was a test case," he said in a speech to some of the 10,000 British troops stationed in and around Basra (search), 340 miles southeast of Baghdad.

"If we backed away from that, we would never be able to confront this threat in the other countries where it exists."

Saddam's Iraq, Blair said, embodied the dual threats facing the world: terrorism, which he called "a perversion of the true faith of Islam," and brutal and repressive regimes that use weapons of mass destruction.

Those threats produce chaos and "the whole world system, economically and politically, breaks down," the prime minister said.

Later, in a briefing on his plane, Blair said the Iraq invasion serves as a warning to other "rogue repressive states developing weapons of mass destruction," which include nuclear, biological and chemical.

"It's important to say to countries that may have engaged in such programs: 'Look, there's a different way of dealing with this,"' Blair said.

Since the invasion, Libya and Iran have allowed initial visits by U.N. inspectors and there are hopes it also will curb and influence other countries accused of pursuing programs with weapons of mass destruction.

Blair flew into Iraq's second-largest city by military aircraft from the Egyptian Red Sea resort of Sharm el-Sheik, where he was vacationing with his family. A Flash Airlines jet taking off from the resort on Saturday crashed into the sea, killing all 148 people on board. The Egyptian government said the crash was an accident, not terrorism.

The British prime minister visited a new police academy in the town of Az Zubayr, where he watched Iraqi officers training in self-defense. He met military police from Britain, Denmark, the Czech Republic and Italy.

Basra has been relatively peaceful since it is dominated by the majority Shiite Muslims who were long oppressed by Sunnis favored by Saddam. Officials reported Sunday that a lawyer appointed by the coalition to run one district of the city had been assassinated by unidentified gunmen, though the motive for the slaying was not immediately known.

Blair met the governor of Basra, Judge Wael Abdullatif, at one of Saddam's former palaces, a marble and mosaic expanse that is a base for Britain's 20th Armored Brigade. The governor thanked the British leader for helping rid Iraq of Saddam's dictatorship.

Standing on a terrace overlooking the Shatt-al-Arab River, Blair said that reconstructing Iraq was a "difficult task but one that is immensely important to the whole world."

Blair's trip follows President Bush's surprise Thanksgiving Day visit on Nov. 27 to Baghdad and a visit by Spanish Prime Minister Jose Maria Aznar on Dec. 20. Blair last visited Iraq in May.

Britain sent about 46,000 British troops to the Gulf region and has reported 52 deaths.

In other Iraq developments, an American soldier was shot and wounded during a foot patrol in the city of Tikrit on Sunday, said Maj. Josslyn Aberle, a spokeswoman for the U.S. Army's 4th Infantry Division. He was in stable condition, she added.