Italian Prime Minister Silvio Berlusconi has signed an agreement to pay Libya $5bn as part of a deal to resolve colonial-era disputes.
Libyan leader Col Muammar Gaddafi said the settlement signed in the city of Benghazi opened the door to partnership between the two states.
Mr Berlusconi said the deal, which sees the money being released over 25 years, ended "40 years of misunderstanding".
Libya was occupied by Italy in 1911 before becoming a colony in the 1930s.
The former Ottoman territory became an independent country in 1951.
This is the first African country to be compensated by a former colonial master, the BBC's Rana Jawad reports from Benghazi.
The question is, she adds: will this latest move set precedents for other former African countries to follow suit?
Mr Berlusconi explained that $200m would be paid annually over the next 25 years through investments in infrastructure projects, the main one being a coastal motorway between the Egyptian and Tunisian borders.
The headless statue was displayed when the two leaders met
There will also be a colonial-era mine clearing project.
As a goodwill gesture, Italy also returned an ancient statue of Venus, the headless "Venus of Cyrene", which had been taken to Rome in colonial times.
The settlement was a "complete and moral acknowledgement of the damage inflicted on Libya by Italy during the colonial era", the Italian prime minister said.
"In this historic document, Italy apologises for its killing, destruction and repression against Libyans during the colonial rule," Col Gaddafi said for his part.
The agreement was signed in the Benghazi palace which once housed the Italian colonial administration, Reuters news agency reports.
Rome and Tripoli have spent years arguing over compensation for the colonial period.
Mr Berlusconi's one-day trip was his second since June when illegal immigration from Africa to Europe was the key issue of talks.
Italy has been swamped by thousands of African migrants trying to reach its shores by boat.
Libya has come in from the diplomatic cold since 2003 when it abandoned efforts to acquire weapons of mass destruction.
Next week, US Secretary of State Condoleezza Rice is scheduled to make the first high-ranking American visit to Libya since 1953.
Italian Prime Minister Silvio Berlusconi and Libyan leader Col Muammar Gaddafi shake hands
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.