Condoleezza Rice on her way to Libya. Photograph: Miguel Riopa/AFP/Getty images

Condoleezza Rice last night became the most senior US official to visit Libya in more than half a century when she arrived for a meeting with its leader, Muammar Gadafy.

The visit, which Rice described as historic, was a reward for Gadafy's strategic decision over the past seven years to distance himself from extremism and give up weapons of mass destruction, providing a positive example to Iran.

It was also designed to highlight a rare diplomatic success for the Bush administration in its final months. Washington claims the Iraq invasion is partly responsible for Gadafy's decision to surrender a nuclear programme built from components bought from the notorious Pakistani nuclear smuggler AQ Khan.

Gadafy greeted Rice at his official Bab Al Azizia residence - the fortified compound targeted by US aircraft in 1986. After a traditional Ramadan meal in a Bedouin tent, Rice said that the meeting marked a new phase in the two countries' relations.

"After many, many years, it's a very good thing that the United States and Libya are establishing a way forward," she said. "The US, I've said many times, doesn't have any permanent enemies."

The visit was kept secret until a few hours before Rice landed. It was agreed only on Wednesday after a deal was struck on a joint fund to compensate the civilian victims of a Libyan bomb attack on a Berlin disco in 1986, American air strikes on Tripoli and Benghazi the same year, and the bombing of Pan Am 103 over Lockerbie in 1988, in which 270 were killed.

In 2001, a Libyan intelligence agent handed over by Gadafy was found guilty of the Lockerbie bombing. In 2006, Libya was removed from the US state department list of sponsors of terrorism.

The compensation issue had yet to be finally resolved when Rice landed, as Libya had not made an expected payment.

"It is a historic moment and it is one that has come after a lot of difficulty, the suffering of many people that will never be forgotten or assuaged," Rice told reporters in Lisbon.

The state department team was reportedly nervous about Rice's meeting with Gadafy, who has been unstatesmanlike in previous remarks about her. "I support my darling black African woman," Gadafy told al-Jazeera television last year. "I admire and am very proud of the way she leans back and gives orders to the Arab leaders ... Leezza, Leezza, Leezza ... I love her very much. I admire her and I'm proud of her because she's a black woman of African origin."

The US and Libya are expected to sign a trade and investment deal. They are also negotiating a "military memorandum of understanding" on combating terrorism.