President Obama has bluntly instructed his national security team to treat Afghan President Hamid Karzai with more public respect, after a recent round of heavy-handed statements by U.S. officials and other setbacks infuriated the Afghan leader and called into question his relationship with Washington.

During a White House meeting last month, Obama made clear that Karzai is the chief U.S. partner in the war effort -- which will be reflected in his visit to Washington that begins Monday, according to senior administration officials. In doing so, Obama is seeking to impose discipline on an administration that has sent mixed signals about Karzai's legitimacy and his value to the U.S.-led counterinsurgency campaign. As a result, Karzai threatened to join the Taliban just days after Obama concluded his first presidential trip to Kabul in late March.

After a two-hour palace meeting that advisers to both leaders described as productive, Karzai grew bitter after receiving a copy of comments made by Obama's national security adviser on the way to Kabul that struck him as insulting. Days later, Karzai read in a newspaper article that an unnamed U.S. official was threatening to put Ahmed Wali Karzai, his half brother, on the military's kill-or-capture list.

Karzai had been led to believe months earlier that his brother -- the leader of Kandahar's provincial council -- would remain in his post despite persistent accusations of corruption and ties to drug trafficking. Karzai erupted in anger soon after, stunning the White House.

"There has been a rough patch," said a senior administration official who participates in Afghanistan policy development. "Frankly, some of what Karzai said needed to be responded to. But the bottom line is that there has been an improvement since then in the atmospherics and in the substance of our dealings with President Karzai and his team."

Managing the relationship with Karzai is part of the far broader challenge of maintaining political support for a nearly nine-year-old war, which a new Washington Post-ABC News poll found is once again opposed by a majority of Americans. Fifty-two percent of respondents said the war is not worth fighting, which means the bump in support for the war that followed Obama's announcing his new Afghanistan strategy in December has disappeared.

Karzai's meeting with Obama in the Oval Office on Wednesday will be the centerpiece of a rare extended visit. Over the next four days, Karzai and many of his senior cabinet ministers will be publicly embraced and privately reassured by Obama of the U.S. commitment to Afghanistan, which officials say will endure long after American forces begin leaving in July 2011.

Karzai has been frightened by the deadline, U.S. officials acknowledge. Obama intends to devote much of his meeting with him to spelling out a long-term relationship that includes far fewer U.S. troops but deeper diplomatic and economic support.

It is not certain whether the message discipline will be able to reset what has long been a complicated relationship. Despite Obama's edict that the Afghan leader receive public support, deep policy differences remain inside the administration, including among top U.S. officials in Afghanistan, over Karzai's commitment to the government and security reforms essential to the U.S. mission.

Some of the mixed signals in recent months appear to be a direct result of the president's actions. In contrast to George W. Bush, Obama established more of an arm's-length personal relationship with Karzai. He also raised questions about Karzai's viability as a partner during a White House strategy review of the Afghanistan war last fall.

But Obama now wants his administration to close ranks, senior officials said.

Karzai's visit has been designed to be "a manifest demonstration of the relationship and the issues we are working on," the senior administration official said. Karzai will be hosted at dinners by Secretary of State Hillary Rodham Clinton, whom he trusts perhaps more than any other U.S. official, and Vice President Biden, with whom he has had a stormy relationship.