Brazilian President Lula (L) said the deal with Paraguay was 'historic'
An agreement over one of the world's largest hydro-electric dams signals a change in relations between Brazil and Paraguay, writes the BBC's Andrea Machain.
Itaipu - the world's largest dam in terms of energy generation - is owned equally by Brazil and Paraguay.
a deal signed by the nations' presidents
after months of tough negotiations, Paraguay's sovereignty over it has been acknowledged.
The 31-point document, signed by Presidents Luiz Inacio Lula Da Silva from Brazil and Fernando Lugo from Paraguay, was signed in Asuncion, Paraguay.
It concedes to Paraguay the possibility of selling its share of the electricity directly to the Brazilian market and triples Brazilian compensation payments for the use of its energy.
The deal is considered a significant victory for Paraguay's government.
"The opening of the markets is key to Paraguay development and its energy-generating capacity," Carlos Mateo, Itaipu-Paraguay director, told the BBC.
The Itaipu power plant is built on the Parana river in the region known as the triple border.
Inaugurated in 1984, its 20 generator units have an installed capacity of 14,000 megawatts of energy, some 90% of which is used by Brazil.
For many years, Paraguay complained about some unfair aspects of a treaty signed in 1973, when military governments ran both countries.
That treaty required Paraguay to sell its unused electricity to Brazil at a fixed price until the treaty expires in 2023.
In return, Brazil would pay Paraguay a lump sum in compensation which today amounts to $124 million a year.
"The deal was always considered unfair by Paraguayans, especially when you think that Paraguay and Brazil paid for the dam equally," says Itaipu Paraguayan council member Carlos Alberto Gonzalez, a respected lawyer and former ambassador to Brazil.
"Each of the countries invested $100 million initially and the rest of the money came from loans."
Many in Brazil feel that Paraguayan claims are out of place, particularly as they believe Brazil paid for the dam alone.
This is untrue, Mr Gonzalez says, because Brazil only acted as a guarantor for the initial loans used to build the dam, but these loans are being paid with funds generated by Itaipu energy sales.
Matters were made worse in 1985, when Paraguay agreed to Brazil's request to sell Itaipu's electricity below market prices in order to fight an economic crisis in Brazil.
During four years Itaipu lost $4 for each megawatt of the electricity it produced.
This continuous loss led to a debt that Paraguayan authorities deem illegal.
The main creditor for this debt is Electrobras, the state-owned Brazilian Electricity Company and main Itaipu electricity buyer.
This matter was not addressed in the most recent agreement.
In spite of industrial growth elsewhere in the region, in the last 25 years Paraguay has only increased its share in the use of Itaipu electricity from 2% to 10%.
The country also failed to attract significant investments for electro-intensive industries because of its old transmission lines.
"The lines are obsolete," says Carlos Mateo, Itaipu-Paraguay director.
"We lose about 40% of the electricity in transmission. About 25% is lost as a result of overload and 15% is stolen with illegal connections."
The new deal signed with Brazil also contemplates building a powerful electricity line to the capital.
This line will be completed in the year 2012 and will be fully paid by Itaipu.
Many may wonder why Brazil changed its attitude towards Paraguay after so many years of denying the possibility of reviewing the original arrangements.
Some think it may have to do with President Lula's personal sympathy towards former bishop Fernando Lugo, who won elections in Paraguay last year after 60 years of rule by the Colorado Party.
But it may also have to do with Brazil's new concept of leadership in the region.
"Leadership comes with responsibility and Lula has incorporated Paraguay in his concept of social inclusion," says Dr Mateo.
"It is not convenient for Brazil to have a poor and powerless neighbour."