Brazil has agreed to triple its payments to Paraguay for energy from a massive hydro-electric dam on their border, ending a long-running dispute.
Under the accord, Brazil will pay Paraguay $US360 million per year for energy from the Itaipu plant, which they jointly-operate. It is one of the biggest in the world.
Brazilian President Luiz Inacio Lula da Silva called it a "historic agreement" after talks in Paraguay.
The deal is a political victory for President Fernando Lugo of Paraguay whose government campaigned on an election promise to gain more revenue from the plant.
Under the deal, Paraguay has also won the right to sell excess energy directly to the Brazilian market, rather than exclusively through a state-owned power utility, Eletrobras.
Paraguay uses only 5% of the electricity produced at the plant.
The BBC reports the joint project was begun in the 1980s when both countries were under military rule.
The agreement was reached after months of negotiations, but analysts say it could still face criticism from opposition leaders in Brazil.