THE FIRST encounter between President Bush and Sen. John F. Kerry last night generated both heat and some illumination about the two candidates' positions on critical questions of foreign policy. Despite rules designed to curtail direct exchanges, there were, under Jim Lehrer's skillful moderation, pointed and serious arguments about Iraq, the threats from Iran and North Korea, U.S. alliances, and the meaning of the war on terrorism. Both the president and his challenger spoke forcefully and, occasionally, with passion: Mr. Bush dismissed Mr. Kerry's arguments as "absurd" and "ludicrous," while Mr. Kerry repeatedly accused the president of exercising bad judgment and not telling the truth to the country.

The center of the debate was Iraq, though the candidates differed more on past actions than on future plans. Mr. Bush stoutly defended his decision to go to war and its results; Mr. Kerry forcefully criticized that decision and the war's management and offered himself as a more competent commander in chief. But Mr. Kerry had a more complicated position to defend, and it showed at times. He called the war a mistake and a diversion, but later said that American soldiers were not dying for a mistake. He implied that money being spent in Iraq could be better spent on prescription drugs for seniors, but insisted, "I'm not talking about leaving. I'm talking about winning."

Mr. Bush was skillful and relentless in underlining these "mixed messages," and in arguing that a president who sent them could not effectively lead U.S. forces or recruit allies. "So what's the message going to be? Please join us in Iraq for a grand diversion?" he demanded at one point. Mr. Kerry seemed not to have an answer to this challenge; his argument that "the real war on terrorism [is] in Afghanistan against Osama bin Laden" seemed to us unconvincing alongside Mr. Bush's repeated insistence that success in Iraq and on other fronts is equally vital to U.S. security. After all, not so long ago Mr. Kerry said he, too, believed that Saddam Hussein represented a grave threat that the United States could not afford to ignore.

Yet Mr. Bush's clarity in defining goals was not matched with candor about conditions on the ground in Iraq. Mr. Kerry pointed to the president's failure to adequately deploy and supply troops, to plan for the postwar period, and to correct his mistakes. "It's one thing to be certain -- but you can be certain and be wrong," he said of Mr. Bush. The Democrat was effective in pointing out how nuclear threats from Iran and North Korea had increased while the administration pursued Saddam Hussein. Yet neither Mr. Kerry nor Mr. Bush appeared to offer a strategy for dealing with those two states that departed from the mostly failed diplomacy extending back to the Clinton administration.

In the end the candidates drew sharply distinct portraits of themselves and each other. Mr. Bush stressed his own resoluteness, which Mr. Kerry suggested included a dangerous tendency to be divorced from reality. Mr. Kerry stressed his commitment to alliances and patient leadership, which Mr. Bush suggested could mean weakness. Both performed credibly enough to keep voters tuned in for the next debate.