Afghan President Ashraf Ghani, speaking to a joint meeting of Congress in Washington, called Wednesday on Muslims around the world to speak out against extremist groups -- declaring "silence is not acceptable." 

In an impassioned address, Ghani said groups like the Islamic State pose a "terrible threat" to the region and said their hatred must be challenged from "within the religion of Islam." 

"We are willing to speak truth to terror," Ghani said of the Afghan people. 

Ghani's message to the Muslim world aligns with recent appeals from a handful of other moderate leaders in the region, including Egyptian President Abdel Fattah el-Sisi. While he warned of what he described as a "darker cloud" of extremism looming over the region, Ghani also voiced hope about Afghanistan's future. 

He said Afghanistan is "uniquely positioned" to block the spread of extremism. "After all, we defeated most of the empires," he chuckled, to laughter from the congressional audience. 

More On This...

Ghani vowed that, together, America and Afghanistan would "finish the job" that began on 9/11. "Afghanistan will be the graveyard of Al Qaeda and their foreign terrorist associates," he said, pledging Afghanistan will "never again" be host to terrorists. 

Ghani said a key goal will be rooting out the "cancer" of corruption, which he pledged to do. The new Afghan president, capping his visit to Washington, repeatedly pledged that his country will eventually be self-sustaining, not reliant on outside aid. Saying he doesn't want Afghanistan to be like a dependent family member, he said: "We are not going to be the lazy Uncle Joe." 

Drawing a distinct contrast with his predecessor, Hamid Karzai, he also repeatedly thanked American soldiers and taxpayers for their support. "We owe a profound debt" to U.S. soldiers he said, paying tribute to their "tremendous sacrifices" and to Americans' "generous support." 

The American-educated Ghani delivered his address in crisp English, and was planning to enter a round of meetings later in the day with congressional leaders. A day earlier, he met with President Obama, who agreed to his request to slow down the planned drawdown of U.S. troops this year. 

The difference between Ghani and Karzai was stark. Whereas Karzai led an insular administration and often spurned the U.S. government, Ghani has struck a conciliatory tone, with Washington and leaders in his own country. 

The visit was designed in part to turn the page in the once-rocky relationship between his government and Washington. The White House said Ghani's speech was indeed an opportunity to mark a new chapter in U.S.-Afghanistan relations. 

Toward the end of his tenure, Karzai did not think the U.S. was holding Afghanistan's interests front and center. He repeatedly railed against the thousands of civilians being killed and said the war against terrorists should not be fought in the villages of his country. U.S. officials and lawmakers did not think Karzai's comments were appropriate given that 2,200 U.S. servicemen and women had been killed and billions of U.S. tax dollars had been spent during the conflict. 

Still, despite being weary of war, lawmakers from both parties praised the White House announcement Tuesday to slow the pace of the U.S. troop withdrawal. 

In a shift from his previous plan, 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 leak into 2017. That means the slowdown won't jeopardize his commitment to end America's involvement in Afghanistan before leaving office. 

Deficiencies in the Afghan security forces, heavy casualties in the ranks of the army and police, a fragile new government and fears that Islamic State fighters could gain a foothold in Afghanistan combined to persuade Obama to slow the withdrawal. 

House Speaker John Boehner, R-Ohio, said the U.S. cannot allow ISIS militants to rise in Afghanistan as they did in Iraq. He criticized Obama's earlier plan for a faster withdrawal, saying the president was "dictating policy preferences divorced from security realties." 

California Rep. Adam Schiff, ranking Democrat on the House Permanent Select Committee on Intelligence, said the U.S. cannot afford to see Afghanistan spiral back into lawlessness and re-emerge as a safe hub for terrorists. He said keeping troops there will also help maintain intelligence on the ground. 

The Associated Press contributed to this report.