(Updates analysis to include news of Federal Police raid on Petrobras headquarters on Friday in 13th paragraph)

By Jeb Blount

RIO DE JANEIRO, April 11 (Reuters) - The purchase of a Texas oil refinery by Brazil's state-run oil company has become a campaign issue as opponents of President Dilma Rousseff use it to attack her reputation as a no-nonsense manager and weaken her lead ahead of the October election.

Rousseff's congressional opposition has convinced their colleagues to open an investigation into Petroleo Brasileiro SA's $1.2 billion purchase of Pasadena Refining Systems Inc.

They say Petrobras paid 20 times the true value for the 100,000-barrel-per-day (bpd) refinery in Pasadena, Texas, and that Rousseff erred in approving the purchase when she was Petrobras' chairwoman in 2006.

The investigation, though, is probably focusing on the wrong refinery.

Even if Petrobras overpaid, the Pasadena refinery may turn out to be the best refining deal the company has made in at least three decades.

Petrobras is paying far more for new refineries in Brazil. The 230,000 bpd Abreu e Lima refinery near Recife, the first built in Brazil since 1980, is expected to cost $20 billion by the time it opens later this year.

Each barrel of new capacity at Abreu e Lima will cost Petrobras about $87,000, seven times more than at Pasadena and two to three times more than similar modern refineries being built elsewhere in the world.

Since Rousseff signed off on Abreu e Lima during her 2003-2010 term as Petrobras chairwoman, the cost has jumped more than four fold.

"I've never heard of a refinery that cost more than that," Sam Margolin, a refining company analyst with Cowan and Company in New York, said of Abreu e Lima. "Refineries are expensive and cost overruns and politics are common, but it still is way beyond anything I've seen anywhere."

For Petrobras, unable to meet gasoline and fuel demand from local refineries and forced to import fuel at a loss because of domestic price controls, getting new refining capacity cheaply is essential, especially with most of its $221 billion, five-year expansion plan focused on oil exploration.

High costs have contributed to making Petrobras the world's most-indebted and least-profitable major oil company.

Rousseff said she was not given complete data on the contract for Pasadena, making it impossible for her to make an informed decision.

Petrobras dismissed the director responsible for the report given to Rousseff and a former head of refining was arrested March 20 in a money-laundering probe. Brazilian police on Friday raided Petrobras headquarters as part of that same investigation, two sources told Reuters.

Critics of the Pasadena purchase have alleged that Petrobras officials may have been bribed to win approval for the sale.

Petrobras declined to comment on Pasadena because it is conducting its own investigation but former chief executive Jose Sergio Gabrielli said this week it was "a great investment."

Rousseff had been expected to easily win re-election in October but her approval rating has dropped in recent weeks to about 36 percent from 42 percent and any scandals from her time at Petrobras could hurt her further.

HIGH COSTS

Refineries are hard to compare. Pasadena is an old facility that needed upgrades while Abreu e Lima is a new "greenfield" refinery with technologically advanced and efficient equipment. But it is still very expensive, even compared to new plants.

Rousseff's government continues to use images of Abreu e Lima in TV commercials praising its successes, and Petrobras has attributed the cost overruns to the difficulty of predicting prices and time frames for equipment, facilities and licenses.

Saudi Aramco and France's Total SA built the 400,000 bpd Jubail refinery in Saudi Arabia for $10 billion, or $25,000 a barrel, less than a third of Abreu e Lima.

China's Sinopec plans to complete a 200,000 bpd refinery in Guangdong next year for $9 billion, or $45,000 for each barrel of new capacity, about half of Abreu e Lima.

Saudi Aramco and Royal Dutch Shell Plc built a 350,000 refinery at their Port Arthur, Texas facility, for $10 billion, or $28,571 a barrel, a third of Abreu e Lima.

Worldwide, new heavy-oil refining capacity is being added for "at most" $38,000 to $45,000 a barrel according to a U.S. refining consultant who has worked on refineries in North America, the Middle East, Latin America and Asia.

He called Abreu e Lima "exorbitant" even with delays typical in Latin American projects. A similar Ecopetrol SA refinery in Colombia was delayed 1 to 2 years and has increased in price by nearly 50 percent but has yet to reach the $37,000 per barrel, less than half that of Abreu e Lima.

In the end, the Pasadena refinery has a good chance of making a profit while Abreu e Lima will probably never cover its costs.

Refiners along the U.S. Gulf Coast where Pasadena is located make about $10 for each barrel refined, according to Margolin at Cowan and Company and Allen Good, an oil and refining-stock analyst with Morningstar in Chicago.

If Petrobras could reproduce those refining margins in Brazil, it would take more than 20 years for Abreu e Lima to repay its cost. Petrobras' refining division, though, lost nearly $11 for each barrel processed in Brazil 2013 and nearly $16 a barrel in 2012, according to its 2013 financial results.

Based on a cost of $1.2 billion, Petrobras could probably make back its investment in Pasadena in 5 years, Good said.

That may be down to luck rather than smart investing. When the purchase was approved in 2006, Petrobras was looking for ways to refine its own crude in the United States, which was expected to buy more of Brazil's growing output.

The U.S. shale-oil boom has since made such refineries more valuable as Gulf Coast refineries stepped up output to meet a backlog in world refining capacity.

The $1.2 billion price tag may also overestimate Pasadena's true cost because it includes $595 million of non-refinery costs, including Astra's share of petroleum at the plant as well as legal fees and fines. Good and Margolin said those costs should be excluded from the refinery's valuation.

When they are stripped out, Pasadena cost $486 million for the refinery itself, or $4,860 a barrel, 18 times less than Abreu e Lima and an amount that could be repaid by running the refinery at full capacity for about a year.

"It makes little sense to get worked up about Pasadena when you consider what Petrobras is paying for refining capacity in Brazil," Good said. "At those prices, it makes more sense for Petrobras to buy U.S. refineries than to build in Brazil."

Gabrielli, Petrobras' former CEO, also questioned the $1.2 billion tag and said Pasadena cost less than $500 million.

POLITICAL GASOLINE

Pedro Galdi, chief analyst with SLW Corretora, a Sao Paulo brokerage, says investigators should focus much more on Abreu e Lima than on Pasadena.

"All Petrobras refineries are in some way outside of the norm, and I have little doubt that if they actually establish a formal congressional investigation, that will come out very clearly," he said. "There was serious mismanagement."

Abreu e Lima grew out of a deal between former Brazilian President Luiz Inacio Lula da Silva and former Venezuelan President Hugo Chavez.

It was supposed to get 60 percent of its oil from Brazil and 40 percent from Venezuela to showcase international friendship and boost regional industry. But to handle Venezuelan crude, which is heavier and more infused with toxic pollutants than Brazilian grades, Petrobras needed two separate refining lines or "trains" and had to put in additional treatment facilities.

The original $4.8 billion budget quadrupled and the Venezuelans backed out. Meanwhile, the new Suape industrial complex where Abreu e Lima is located is the subject of widespread corruption and mismanagement allegations.

That may limit interest in a wider refinery investigation.

Government officials have warned Pasadena's critics that a wider probe could rebound on them. Abreu e Lima is located in Pernambuco, the state where Eduardo Campos, one of Rousseff's two main election rivals, is a former governor.

"The Pasadena probe should continue, but Pasadena is only the tip of the iceberg, said Adriano Pires, head of the Brazilian Infrastructure Institute, a Rio de Janeiro energy consultancy. (Editing by Jonathan Leff and Kieran Murray)