BENGHAZI, Libya — Italy agreed over the weekend to pay Libya $5 billion as compensation for its 30-year occupation of the country, which ended in 1943.

Prime Minister Silvio Berlusconi of Italy and the Libyan leader, Muammar el-Qaddafi, signed a memorandum pledging a $5 billion compensation package that involves construction projects, student grants and pensions for Libyan soldiers who served with the Italians in World War II.

"It is a material and emotional recognition of the mistakes that our country has done to yours during the colonial era," Berlusconi said Saturday as he arrived. "This agreement opens the path to further cooperation."

In return, Italy wants Libya to crack down on the thousands of illegal migrants smuggled across the Mediterranean to Italian shores. Libya has largely not delivered on pledges over the past few years to eliminate the problem. Italy will pay for $500 million worth of electronic monitoring devices on the Libyan coastline.