Most of Brazil's vast offshore oil riches are still locked deep under the Atlantic Ocean but the fight for the spoils has now begun in earnest.

In a decision with echoes of Canada's controversial National Energy Program, the Brazilian legislature passed a new royalty scheme that would drastically cut the oil revenues paid to Rio de Janeiro and the two other oil producing states, Espirito Santo and Sao Paulo, and instead hand over much more of the new wealth to Brazil's remaining 23 states.

The plan has already been approved by large majorities in the House and the Senate and only needs to be signed, later this week, by President Dilma Rousseff to become law.

Dilma, as she is known here, is under huge pressure by the oil-producing states — Rio especially, whose governor is a political ally — to block the bill, or at least some portions of it. 

Rio is gearing up to host the 2014 World Cup of soccer and the 2016 Summer Olympics and it says it is counting on that money to put all the needed new facilities in place.

Both events are at risk, Rio's governor says — certain projects have already been put on hold — if this federal law goes through.

To ramp up the already ample political pressure on the president, the state of Rio sponsored a huge rally Monday, even giving its public servants the afternoon off to attend.

Police say as many as 200,000 people, including actors, singers and athletes, filled the downtown streets asking the president to kill the bill. She has until Friday to make the call.

Down this path before

Brazil is currently sitting on some of the biggest oil reserves in the world, billions of barrels worth buried kilometres beneath the seabed under layers of rock and salt.

brazil-oil-280-03645757

'Veto Dilma' reads the sign in Portuguese, one of many in a huge rally in Rio de Janeiro on Monday over the proposed new royalties law. (Victor R. Caivano / Associated Press)

Discovered in 2007, there is enough wealth here to transform Brazil's economy and vault it into the world's top tier of nations. But getting at this resource is proving to be not just a technological challenge, but a political one as well.

In her weekly column, President Rousseff said that "if we use the royalties from this oil responsibly, it will be a passport to transforming Brazil into a more developed nation with more opportunities for the entire population."

But the first attempt at divvying up the royalties, in 2010, was vetoed by then president Luis Ignacio Lula da Silva, who sided with the oil-producing states.

Rio's governor, Sergio Cabral, now wants Dilma to follow in her predecessor's footsteps.

He says if this legislation passes, his state might as well close up shop.

"This bill will result in the collapse in our public finances … We won't be able to hold the Olympics or the World Cup. We won't be able to pay public servants, retirees or pensioners."

Court challenge?

Cabral and his fellow oil-producing governors say the bill is unconstitutional because it amounts to a  "confiscation of resources," which are guaranteed to Brazil's states under the constitution.

They say they will ask the country's supreme court to strike it down if President Rousseff doesn't do it first.

But federal politicians, led by Senator Vital do Rego who sponsored this legislation, say Rio will still do well under the new royalty regime and that it's only fair that all Brazilians benefit from the country's windfall.

"In our estimation, everyone will win under this new legislation. It allows for social equality in the distribution of Brazil's biggest natural resource," says do Rego.

Do Rego's new formula would cut royalties for oil producing states from 26 per cent to 20 per cent, starting as soon as January, when the law is set to kick in.

The 23 non-producing states would get 21 per cent of the pie next year, up from the modest seven per cent they currently receive, while the federal government's share would drop from 30 per cent to 20. Municipalities share the rest.

Fair enough on the surface, perhaps. But the state of Rio says it will lose as much as $1.7 billion next year alone, money that has already been budgeted, and up to $36 billion by 2020 when state-owned Petrobras expects to be almost tripling its current output.

Dilma's dilemma

As for Rousseff, she has made it plain she doesn't like parts of the legislation. She wanted all royalties to be spent on education, Brazil's Achilles heel.

dilma-280-02756503

Brazil President Dilma Rousseff has until Friday to veto the new royalties law, or live with the consequences. (Associated Press)

Her government had promised to spend big bucks on improving the country's public education system but never specified exactly where all that money would come from.

This bill doesn't guarantee any of the oil money will go to education. It also looks like it might further muddy the offshore waters when it comes to foreign investment.

Next year, Brazil is supposed to auction off oil concessions in the sub-salt region, and if the rules of the royalty game are in question, or before the courts, that might scare away some of the foreign money the government was counting on to pay for big infrastructure projects and the president's anti-poverty programs.

Some here are suggesting that one way out for Rousseff would be to limit the bill so that the new formula would only apply to new wells, which would give the oil producing states at least some of what they want and help pay for those new building projects that are already on the books.

Rousseff is bound to be criticized no matter what she does with this sensitive issue.

But taking a little political heat now seems a small price to pay when you are the president who gets to hand out a fortune from black gold to such a needy nation.