Brazil and Venezuela have pledged closer trade and energy ties, including building a new oil refinery in Brazil.
Venezuela has been helped by high oil prices
The announcement followed talks between Venezuelan President Hugo Chavez and Brazilian President Luiz Inacio Lula da Silva in Caracas.
The refinery in north-eastern Brazil will be 40%-owned by Venezuela's state oil firm PDVSA, while Brazil's national oil firm Petrobras will hold the rest.
The $4.5bn (£2.2bn) scheme, open from 2010, is to be supplied by Venezuela.
The refinery had originally been planned as a 50-50 joint venture between the two nations, but talks had come to a standstill over the summer.
Mr Chavez said: "A joint company will be formed in Brazil for the construction and operation of the 200,000 barrels a day Abreu de Lima refinery in Pernambuco."
Brazil, which recently announced the discovery of up to eight billion barrels of oil offshore, hopes to become an increasingly important energy supplier, and has even considered the possibility of joining oil cartel Opec.
President Lula said he hoped closer links between the two countries would lead to an improved "balance" between the two countries.
According to Bolivarian news agency AMN, Brazil exports to Venezuela rose to $3.8bn in the first 10 months of 2007, up nearly 30% year-on-year, while Venezuela's exports to Brazil dropped 44% to $269m in the same period.