By Hannah Hennessy
BBC correspondent in Lima
Impoverished South American neighbours Bolivia and Peru have signed an agreement to allow landlocked Bolivia to export gas through Peru.
The two presidents shake on a deal they hope will benefit both sides
The deal comes a month after Bolivians voted in a referendum to develop and export more of their country's vast natural resources.
The agreement marks a step forward along a long, controversial path.
Bolivia is the poorest country in South America, but has the second largest natural gas reserves after Venezuela.
The letter of intent signed on Wednesday promises Bolivia access to the sea for the first time in 125 years.
It backs the creation of a bilateral commission to work on developing a special economic zone on Peru's Pacific coast from where Bolivia will be able to export its gas.
In the past, Bolivia's natural resources have not really benefited the Bolivian people, but by exporting the gas from Peru, Bolivians hope to be able to access lucrative markets in Mexico and the United States.
Last month's referendum paved the way for Bolivia to develop and export natural gas reserves worth more than $70bn.
In October, Bolivians violently rejected proposals to export the gas via a port in Chile, a long time enemy of Bolivia.
More than 50 people died in the violence which brought down the government.
Bolivia lost its access to the sea in 1879 after a war with Chile. Peru also lost land in the war.
Peru's President Alejandro Toledo said the special economic zone would be developed around the southern port of Ilo. Peru is likely to benefit from increased trade and job opportunities in the area.