FILE - In this April 11, 2015, file photo, President Barack Obama and Brazilian President Dilma Vana Rousseff shake hands during their bilateral meeting at the Summit of the Americas in Panama City. (Pablo Martinez Monsivais/AP)

In March 2011, President Obama swept onto the stage at the Municipal Theater here to tumultuous applause.

“I met with your wonderful new president, Dilma Rousseff, and talked about how we can strengthen the partnership between our governments,” he told an invited audience.

“For so long, you were called a country of the future, told to wait for a better day that was always just around the corner. Meus amigos, that day has finally come,” Obama said. Both countries had much in common, he added.

Four years later, as Rousseff begins a visit to the United States, it is a different story.

Brazil, whose GDP boomed by 7.5 percent in 2010, is skidding into recession. Inflation is at 8.5 percent. Rousseff has denied knowledge of a multibillion-dollar corruption scandal at the state-controlled oil company, Petrobras, that prosecutors allege involved bribes and campaign donations to politicians and her own Workers’ Party and other allied parties.

Eight months after winning a second term, her approval rating is at 10 percent, according to a June poll by the Datafolha institute. And as her administration forces a controversial package of budget cuts through the Congress, Brazilians wonder whether the golden future that Obama predicted has again slipped from their grasp.

Rousseff’s visit originally was planned for two years ago, but she canceled it after allegations that the National Security Agency had spied on her and on Petrobras. Now Brazil’s contracting economy has made a trip to the United States more imperative.

“A lot of it has to do with the need of the Brazilians for foreign direct investment,” said Carl Meacham, Americas program director at the Center for Strategic and International Studies in Washington.

Rousseff was in New York on Sunday and will spend Monday meeting with bankers and ­investors, helping to sell a ­much-needed $63 billion infrastructure package.

From New York, she flies to Washington, where she will meet with Obama, attend a dinner hosted by the president as well as a State Department lunch with Vice President Biden, who has played a key role in the rapprochement between the two countries.

“Dilma has a lot more to gain and also to lose than Obama,” said Jason Marczak, deputy director of the Atlantic Council’s Adrienne Arsht Latin America Center in Washington. “This visit is an opportunity to reset relations at a presidential level.”

Her agenda covers the usual array of topics, but probably the most important theme is climate change. A headline announcement on the climate is expected before the U.N. Climate Change Conference in Paris in December.

“It will be a political declaration . . . with the indication of what both countries are willing to do in this area,” Carlos ­Paranhos, undersecretary for policy at the Ministry for Foreign Affairs, said at a news conference in Brasilia, the capital, on Thursday.

Mark Feierstein, senior director for Western Hemisphere affairs for the National Security Council, noted in a conference call with reporters last week that Biden had brought up the climate question in a phone call to Rousseff on Thursday, “in anticipation that the two presidents will be able to move forward on this issue during this visit.”

Trade and commerce, defense and security, regional and global cooperation and education and technology issues were all also on the agenda. “The two countries currently do $100 billion in trade,” Feierstein said. “And we think that we can double that trade again over the next 10 years.”

On Wednesday, in Northern California, Rousseff will visit Stanford University, a NASA research center and Google’s headquarters.

Rousseff has had little time to devote to foreign policy since first being elected in 2010. “She does not like it, and she does not have patience for the liturgy, the diplomatic niceties, of international relations,” said Luiz ­Augosto de Castro Neves, president of the Brazilian Center for International Relations, a Rio think tank, and a former Brazilian ambassador to China and Japan.

But the need to change an economic model based on protectionism, consumer spending and high commodity prices has helped persuade Rousseff to change course.

In May, she announced billions in investments during a visit by Chinese Premier Li Keqiang. Earlier this month she was in Brussels to announce that Brazil and the South American trade block Mercosur were ready to offer a long-delayed trade deal with the European Union. “There are signs that Brazil is being forced to change,” Marczak said.

As for the NSA spying allegations, “the episode has been overcome,” de Castro Neves said.

Rousseff received assurances, she told reporters after meeting with Obama at the Summit of the Americas in April in Panama, that “brother countries will not be spied on. And also a declaration from President Obama, when he wants to know something, he calls me.”

The United States also has made gestures seen as important in Brazil, where U.S. logistical and political support for a 1964 military coup still resonates. As a member of a left-wing armed-resistance group, Rousseff was imprisoned and tortured by that dictatorship, which ran Brazil for two decades.

“Much of the Brazilian foreign policy was the search for other alliances to reduce the overwhelming presence of the United States in the region,” de Castro Neves said.

The end of official hostility between the United States and Cuba earlier this year created a sea change in the region. “The Cuba policy is having a very big impact,” Marczak said, noting that Rousseff applauded Obama when he walked onstage at the Panama Summit meeting, two years after canceling her U.S. visit. “It is about a new shift across the Americas.”

Rousseff is bringing two defense accords between Brazil and the United States that had been stalled since 2010 and were ratified by the Brazilian Congress in a concerted push this week.

“We made an effort for this,” said Eduardo Cunha, speaker of Brazil’s lower house of Congress.

U.S. officials see the relationship with Brazil as one that tends not to produce concrete, specific agreements. “The biggest purpose of this trip,” Meacham said, “is the reestablishment of trust between the two countries.”