For Brazilians, President Rousseff made the right decision in delaying a state visit to the U.S.

Brazilians tuning into the Globo Network’s Fantástico news show on successive Sunday nights this month were taken aback by allegations that the United States not only spied on their president but also was monitoring Petrobras, the state-run oil company.

The charges that the National Security Agency carried out cyber-espionage in President Dilma Rousseff’s office and kept track of her conversations with cabinet members raised nationalistic hackles in Brazil.

While Rousseff’s response — the postponement of a state visit to Washington scheduled for late October — was a setback in diplomatic relations between the hemisphere’s two largest democracies, the decision played well in Brazil.

“Her decision has been accepted by most people as inevitable in light of the allegations. Brazilians don’t feel good about the U.S. spying on the president of a country that has been described as an important strategic partner,’’ said Paulo Sotero, who heads the Brazil Institute at the Woodrow Wilson Center.

Even before the postponement was announced last Tuesday, the perceived attacks may have helped Rousseff in the polls. After a difficult summer marked by massive domestic protests and a lackluster economy, Rousseff’s approval rating fell 24.4 points to 49.3 percent from June to July in a poll conducted by MDA Research for the National Transport Confederation.

But the latest MDA poll taken mostly in early September — after Glenn Greenwald, a Guardian correspondent living in Rio de Janeiro, appeared on the popular Fantástico program and made the espionage allegations based on documents leaked by former NSA contractor Edward Snowden — showed Rousseff’s approval rating had climbed to 58 percent.

President Barack Obama called Rousseff last Monday night trying to convince her to make the trip, which would have been the first state visit by a Brazilian president in 18 years, but in the end analysts say her calculation was there was little upside to traveling to Washington.

“It really wasn’t a good environment to tackle issues aiming at making a better U.S.-Brazil relationship,’’ said Sotero.

The statement issued by the White House on the postponement echoed that theme. The relationship between the largest economy in South America and the United States “should not be overshadowed by a single bilateral issue, no matter how important or challenging the issue may be,’’ it said.

Another factor may have been the risk of more revelations coming out in the media during the visit, resulting in a “double embarrassment” for both presidents, said Rubens Barbosa, a former Brazilian ambassador to Washington and now a business consultant in São Paulo.

Some in Rousseff’s cabinet urged her to cancel the trip outright and members of her leftist Workers Party were pushing for the recall of the Brazilian ambassador to Washington, but her decision to simply postpone the trip allows some room for diplomatic finesse.

But analysts said if she doesn’t make the trip by early next year, it might not happen because in 2014 Brazil will be in full-fledged campaign mode leading up to the October 5 presidential election.

“I think it will be difficult for a state visit in the middle of the election season,’’ said Barbosa.

Rousseff has said that she needs a public apology from the Obama administration.

So far she hasn’t gotten it. The White House statement did say, however, that Obama “understands and regrets the concerns that disclosures of alleged U.S. intelligence activities have generated in Brazil....”

U.S. officials said such an apology is unlikely, especially before an inquiry into NSA procedures is completed, because it makes the president subject to domestic criticism that he is relinquishing U.S. authority to collect intelligence.

But Barbosa said for the state visit to be rescheduled, “some sort of satisfaction will have to be given to President Rousseff. The problem today is a question of trust and that will have to be restored.

“Everyone knows that everyone spies on everyone,’’ he said. The problem, Barbosa said, is that such activities aren’t generally aired in such a public manner.

Meanwhile, there has been speculation that given the sluggishness of the Brazilian economy, the summer protests that took aim at everything from government corruption to shortcomings in public transportation, healthcare and education, postponing the trip might have been politically motivated.

“There was a political component but I don’t think it was the prevailing factor,’’ said Barbosa. “I think she was genuinely upset.’’

Any political mileage that Rousseff got out of the postponement is a “bonus,’’ not a motivation,’’ said Sotero. “I don’t think playing an anti-American card helps much with the elections.’’

In general, he said, anti-Americanism doesn’t play that well in Brazil, especially among the emerging middleclass.

And Rousseff is nothing if not a pragmatist. “She knows a closer relationship with the United States is fundamental for Brazil to improve its global competiveness,’’ said Sotero.

Although China has supplanted the United States as Brazil’s main trading partner, the business-to-business relationships between the two countries remain strong.

Rousseff is very much focused on Brazil taking what she sees as its rightful place as an emerging global power and she doesn’t like to be pushed around.

When she welcomed President Obama to Brazil during his 2011 visit, she emphasized that any true alliance between the two countries needed to be “amongst equals.”

The Snowden revelations have set the U.S.-Brazil relationship back, said Eric Farnsworth, vice president of the Council of the Americas and Americas Society.

“It was a significant slap in the face of the United States,’’ he said. But “it doesn’t mean the relationship is blown up. It does mean the momentum for a better relationship has dissipated.’’

Despite the temporary diplomatic stickiness the postponement is causing, Barbosa said, “the governments are treating this as business as usual.’’

So-called dialogues on issues of mutual concern, such as strategic energy, economic and financial matters, investment and defense cooperation, are continuing.

And other analysts also said they expect the business relationships between the two countries will continue as usual — good news for South Florida whose largest trading partner is Brazil

“Business between the two countries evolves despite government participation — not because of it and that’s a sad thing,’’ Joao Augusto de Castro Neves, a senior analyst at the Eurasia Group, said Friday during an Inter-American Dialogue seminar analyzing U.S.-Brazil relations.

Brazil, he said, still isn’t quite sure what it wants from its relationship with the United States.

But Rousseff and Obama may get another crack at diplomacy this week on the sidelines of the 68th session of the United Nations General Assembly. Rousseff is scheduled to be the opening speaker when the U.N. convenes Tuesday and her remarks may include a critique of U.S. intelligence-gathering techniques. President Obama, who is expected to focus on the American approach to the Middle East, is next up on the podium.

Related stories from Miami Herald