1 of 3
Pablo Martinez Monsivais, Associated Press
Afghanistan's President Ashraf Ghani speaks before a joint meeting of Congress on Capitol Hill in Washington, Wednesday, March 25, 2015. House Speaker John Boehner of Ohio, right, rear, and Vice President Joe Biden, listen.

WASHINGTON — Afghan President Ashraf Ghani thanked Congress on Wednesday for billions of American tax dollars and vowed his war-wracked country will be self-reliant within this decade.

"We're not going to be the lazy Uncle Joe," he said.

In a speech to a joint meeting of Congress, Ghani moved to mend U.S.-Afghan relations that were frayed under former President Hamid Karzai. Lawmakers have been critical about the lengthy U.S. troop presence in America's longest war, wasteful spending in Afghanistan and were stung by Karzai's anti-American rhetoric.

Ghani humbly thanked Congress for the nearly $107 billion it has appropriated for Afghanistan so far. He paid homage to the 2,200 U.S. servicemen and -women who lost their lives in the war and the thousands more who were wounded, and thanked the U.S. aid workers who built schools, wells and cured the sick.

"At the end of the day, it is the ordinary Americans whose hard-earned taxes have over the years built the partnership that has led to our conversation today," he said to applause in the House chamber packed with hundreds of lawmakers, dignitaries and guests.

Ghani, wearing a gray western suit, peppered his speech with anecdotes about the time he's spent in America, noting that he graduated from Columbia University in New York and was in his World Bank office in Washington when the first plane smashed into the World Trade Center on 9/11.

Perhaps trying to shed his image as a technocrat, Ghani recalled that he "ate corned beef at Katz's, New York's greatest, greasiest, pickle-lined melting pot."

He touched on themes he hoped would convince lawmakers that he will be a reliable U.S. partner. He admitted that decades of war have resulted in high levels of fraud and graft in Afghanistan and promised to eliminate corruption. Ghani also voiced support for women's rights and said he would emphasize law and justice and focus on self-reliance and economic development.

"We don't want your charity. We have no more interest in perpetuating a childish dependence than you have in being saddled with a poor family member who lacks the energy and drive to get out and find a job," Ghani said.

That's a tall order for Afghanistan.

The national unity government that Ghani runs with chief executive Abdullah Abdullah has not yet seated a full cabinet, and some of the country's 32 provinces are still run by acting governors. The country recently had a $500 million budget shortfall and domestic revenues missed targets by 26 percent, forcing the U.S. to step in in recent months to help cover the fiscal gap.

More than a third of Afghans live below the poverty line and the nation's vast mineral resources remain virtually untapped. Afghanistan also is not at peace, and Ghani's efforts to lure the Taliban to reconciliation talks have not yet been fruitful. Just hours before he spoke, at least six people were killed and more than 30 were wounded in a suicide car bombing near the presidential palace in Kabul.

Ghani is untested as a leader, yet he received a warm reception from both Republicans and Democrats on Capitol Hill. The reason: He's not Karzai.

House Speaker John Boehner issued a statement after the speech calling Ghani a "trusted partner." And just before Ghani stepped from the chamber, he and Sen. John McCain, R-Ariz., who is chairman of the powerful Senate Armed Services Committee, embraced in a bear hug.

Obama said the U.S. would leave its 9,800 troops in Afghanistan in place rather than downsizing to 5,500 by year's end. The size of the U.S. footprint for next year is still to be decided, Obama said, but he brushed aside any speculation the withdrawal will bleed into 2017. That means the slowdown won't jeopardize his commitment to end America's involvement in Afghanistan before leaving office.

Obama slowed the pace of the withdrawal because of deficiencies in the Afghan security forces, heavy casualties in the ranks of the army and police, the need for the Ghani-Abdullah government to gain traction and fears that Islamic State fighters could gain a foothold in Afghanistan.

Ghani said IS militants pose a "clear and present danger" to Afghanistan, and he challenged Muslim leaders and intellectuals who believe that Islam is a religion of tolerance and virtue to speak out against Islamic extremism. "Silence is not acceptable,'" he said.

Ghani's speech drew much applause, but his appearance didn't create as much buzz in the Capitol as Israeli Prime Minister Benjamin Netanyahu did when he spoke to Congress earlier this month. Some Democrats skipped the Israeli leader's speech, in which he warned the U.S. that an emerging international agreement the U.S. was trying to reach with Tehran would pave Iran's path to developing nuclear weapons.

Associated Press writer Laurie Kellman contributed to this report.