Condoleezza Rice met Libyan leader Muammar Gaddafi on Friday, on the first trip by a US Secretary of State to its former enemy since 1953.
Libya was on the US State Department list of sponsors of terrorism until 2003, when it abandoned weapons of mass destruction and renounced terrorism.
"This demonstrates that the US doesn't have permanent enemies," Dr Rice said at the start of her visit.
"It demonstrates that when countries are prepared to make strategic changes in direction, the United States is prepared to respond. Quite frankly I never thought I would be visiting Libya and so it is quite something," she said.
Dr Rice met Libya's Foreign Minister Mohammed Abdel-Rahman Shalgam before meeting Mr Gaddafi. They discussed co-operation in various fields, especially in oil and in education, the official Libyan news agency reported.
The US Secretary of State may sign a trade and investment deal during her visit.
Washington is also negotiating a "military memorandum of understanding" with Libya, which cooperates in fighting terrorism and has helped stem the flow of insurgents into Iraq, the State Department said, without giving details.
Dr Rice held back from visiting Libya until a compensation package was signed last month to cover legal claims involving victims of US and Libyan bombings.
US victims covered include those who died in the 1988 bombing of Pan Am Flight 103 over Lockerbie, Scotland, which killed 270 people, and the 1986 attack on a Berlin disco that killed three people and wounded 229.
It also compensates Libyans killed in 1986 when US planes bombed Tripoli and Benghazi, killing 40 people.
The last top US diplomat to visit Libya was Secretary of State John Foster Dulles, in May 1953.