Brazil and Mexico are competing for a diminishing resource: the investment dollars of oil majors beating a retreat from the big-ticket offshore projects they once coveted.

After two waves of resource nationalism that left few openings in Latin America for energy giants such as ExxonMobil Corp. (NYSE: XOM), Royal Dutch Shell Plc (NYSE: RDS.A) and Total SA (NYSE: TOT) , the tables are turning.

Governments throughout the continent are enacting reforms and changing contract terms to lure oil firms that have slashed spending as they adapt to lower crude prices.

Global policy changes to address climate change have given an added sense of urgency to governments in the region and worldwide that are sitting on oil and gas reserves. They want to pump it before it becomes less valuable.

The competition pits Brazil’s high-cost, but prolific deepwater reserves against lower-cost oilfields in Mexico that come with a larger dose of political risk.

“Both are attractive. Both have real potential,” Wael Sawan, Shell’s executive vice president for deepwater, said. “We have as a company, I think as an industry, scarce capital resources to be able to make the investments that the particular projects in deepwater require.”

Sawan is among the executives from the world’s top energy firms who have jetted into Rio de Janeiro this week, hoping to win fields in Brazil’s latest auction.

Brazil has created a more conducive environment for investment than in the past, and venturing into Mexico looks exciting despite concerns over political risk and lack of infrastructure, he said.

Low crude prices have made oil firms choose carefully where they invest, but they need the substantial reserves Brazil and Mexico are offering.

The rate that energy companies replace the barrels (bbl) they produce is a key metric for shareholders, and offshore blocks such as those in Mexico and Brazil come with billions of barrels (Bbbl) in available reserves.

Better terms for technology

Latin American governments have relaxed deal terms and set accelerated auction schedules to lure investment to everything from ultradeep water to mature fields that need specialist technology to squeeze more oil and gas from wells.

To boost its chances, Brazil has ended its requirement for state-controlled Petrobras to be the operator of deepsea projects in the country’s pre-salt province, which contains large volumes of high-value light oil. That gives majors more freedom to manage exploration and output.

Brazil has loosened local content requirements on equipment and supplies, which had previously slowed development, and set out a three-year calendar of oilfield auctions to facilitate planning for foreign firms.

Mexico has countered with an easier qualification process to bid in auctions and is selling geological data on oilfields for majors and service firms to reprocess, while offering flexible local content requirements according to field type.

For many oil majors, the Mexican side of the Gulf offers a familiar geology: the formations below the seabed are similar to those they have drilled for decades in the nearby U.S. waters. But unlike Brazil, there has been no deepwater development in Mexico, so more infrastructure needs to be built.

Beyond the potential of the oilfields, the two countries offer different political challenges.

Mexico’s relatively recent reforms and a presidential election in 2018 imply a high political risk for majors, many of which were squeezed out of their Venezuela holdings by the country’s socialist governments in the last decade.

Foreign firms are beginning to operate in Mexico just as the country's relationship with the U.S. worsens as U.S. President Donald Trump seeks trade concessions from Mexican President Enrique Pena Nieto.

Trump’s public statements on Mexico have riled many Mexicans, giving the leftist opposition firebrand Andres Manuel Lopez Obrador, who is openly critical of Trump, a lift in the opinion polls. Lopez Obrador has said he could hold a referendum on the energy reform if he became president.

“I have no doubts that Mexico could be more attractive than Brazil,” Francisco Monaldi, a fellow in Latin American Energy Policy at Rice University’s Baker Institute, said.

“But the possible combination of Trump and Lopez Obrador is scary for investors,” Monaldi said.

Mexico’s next bidding round should be concluded in January and includes 29 blocks that hold an estimated 4.2 Bbbl of prospective reserves. Another 35 blocks in shallow water areas with potentially 2 Bbbl will follow, with results expected to be announced in March.

Major bids for oil

Brazilian authorities have billed the round to be held on Oct. 27 its most competitive yet. Some 16 firms qualified to bid for blocks in the country’s pre-salt reservoirs, where oil and gas are trapped under layers of salt beneath the ocean floor.

“In the [2016] we have made extraordinary advances in the regulatory framework,” Joao Carlos de Luca, an adviser to the Brazilian Petroleum, Gas and Biofuels Institute, said.. “That has put Brazil back on the map.”

The previous auction, for 287 blocks in September, received $1.2 billion in offers, far more than expected. That was largely down to Exxon, which stole the show with aggressive bids. Until that round, Exxon was one of the few big oil firms absent from Brazil’s offshore areas.

In 2017, Exxon has spent heavily on projects to replenish diminishing reserves, including in the U.S. Permian Basin shale play.

In South America, Exxon has also invested in Argentina’s Vaca Muerta shale areas while venturing into offshore Guyana along with Hess Corp. (NYSE: HES) in a $4.4 billion offshore project.

In Ecuador, where every administration in recent decades has changed the country’s oil contracts, President Lenin Moreno has called two new bidding rounds in 2018 for up to 24 blocks under more attractive terms.

Argentina also plans to announce in 2018 a bidding round for oil and gas exploration blocks off its Atlantic coast after a 15-year hiatus on offshore auctions.

“Current conditions are exactly opposed to those for nationalism. Everybody is now offering fields, but the spots available in the majors’ portfolios under $50/bbl to$60/bbl of crude are just a few,” Monaldi said.

Other oil majors including BP Plc (NYSE: BP) and Chevron Corp. (NYSE: CVX) also are exploring investment opportunities in the region, from the Gulf of Mexico to Argentina.

But making the case within oil majors for offshore capital-intensive projects is a challenge, Javier La Rosa, president of Chevron’s Brazil unit, said at an industry conference in Rio on Oct. 25.

“I face this battle each year when our corporate business plan is put out,” he said. “It is not easy to convince shareholders to spend more money on deepwater fields when there are other lower cost options still available.”