President Abdelmadjid Tebboune and his host Sergio Mattarella met at the Quirinale Palace in Rome, before a meeting with Prime Minister Mario Draghi.
Rome is looking for more energy supply from Algiers as it prepares to cut dependence on Russian gas.
"We are grateful for Algeria's efforts to strengthen this collaboration, as we have seen in recent months. Our energy cooperation naturally also extends to cooperation in the field of ecological transition," said Sergio Mattarella, the Italian President.
Last week, Prime Minister Draghi said his country could be independent of Russian gas by the second half of 2024, longer than earlier estimates.
"Every time production increases, we will be able to supply it to Italy, which can then send it to the rest of Europe. As far as electricity is concerned, we have agreed with our Italian friends to set up a submarine cable from Algeria to Italy," President Tebboune said of the new deal.
Algeria is Africa's leading exporter of natural gas.
Italy is the eurozone's third-largest economy. In 2021, 40 percent of the natural gas that Italy imported came from Russia.