British Prime Minister Gordon Brown is defending his country's decision to go to war against Iraq, saying the Iraqi leadership's failure to comply with United Nations resolutions justified the invasion.

Brown made the remarks Friday during testimony to an official inquiry on the invasion.

While distancing himself from concerns about the threat posed by Saddam Hussein's suspected weapons of mass destruction, Brown said deposing Hussein was the right thing to do.

"My feeling was and still is that we cannot have an international community that works if we have either terrorists who are breaking these rules or...aggressor states that refuse to obey the laws of the international community," he told the inquiry.

He also claimed that ahead of the invasion, both he and his predecessor, Tony Blair, had focused all efforts on finding a diplomatic solution.

"Right up to the last minute, right up to the last weekend, I think many of us were hopeful that the diplomatic route would succeed," he said.

Brown, who was finance minister at the time of the 2003 invasion and was in charge of approving military spending, also insisted that his ministry provided adequate funding for the military action and equipped troops properly.

A total of 179 British soldiers were killed in Iraq before the country's forces withdrew last year. Some relatives of those killed say inadequate funding led to unnecessary deaths. They're demanding that the inquiry's five-person panel press Brown for answers on the issue.

Already, ex-defense secretary Geoff Hoon has told the inquiry that Brown's decisions forced the Defense Ministry to "make some rather difficult cuts." And Gen. Michael Walker, a former head of the British armed forces, has testified that the country's five most senior military chiefs had threatened to resign because of a dispute with Brown in 2004 over funding.

This inquiry is Britain's third and widest-ranging examination of the conflict. It isn't designed to assign blame, but will offer recommendations on how to prevent errors in future conflicts.

It was Brown himself who ordered the inquiry last year, following long-standing calls from opposition politicians and bereaved families.

At first, Brown said the panel would not call government ministers until after national elections, which are expected to be held May 6. But in January, Brown announced he would appear whenever the inquiry asked him.

Blair also made a highly publicized appearance before the inquiry in January. At that appearance, he boldly asserted he had no regrets about the war. He said the decision to back the U.S. in removing Saddam was the right one, because the dictator was a threat to the world.

Among those who have also appeared before the inquiry since it began in November are ex-defense secretary Geoff Hoon, MI6 intelligence agency chief John Sawers, the head of Britain's military Jock Stirrup, and a host of government officials.

The panel is expected to offer its recommendations by the end of the year.

With reports from the Associated Press