U.S. Secretary of State Condoleezza Rice said America had "learned the hard way" not to abandon Afghanistan and would not make the same mistake again, calling the country's emergence from years of warfare and embrace of democracy an inspiration to the world. Rice, on her first visit to the war-ravaged country, said the United States made a mistake by losing its focus on Afghanistan following the Soviet withdrawal in 1989. The country plunged into years of civil war after the withdrawal, allowing the hardline Taliban to take power and turn the country into a safe haven for Osama bin Laden and his al-Qaida terror network. "We have a long-term commitment to this country," Rice said at a joint press conference with Afghan President Hamid Karzai. "We learned the hard way what it meant to not have a long-term commitment," she said. "After the Soviet Union left I think it is well understood that we did not remain committed, and I said to the president earlier that in many ways Sept. 11 was a joint tragedy of the Afghan and American people out of that period." --more 1259 Local Time 0959 GMT