Three months ago it appeared that China’s economy was on track to recover relatively quickly after being closed off to the world during the pandemic. Consumers were spending again. Exports picked up. Even China’s beleaguered housing market gave hints it was stabilizing.

That is no longer the case. Official data released Monday revealed that the annual pace of growth in China’s economy tumbled to just a little over 3 percent in the spring, well below the government’s target.

Now the faltering economy appears to have helped prompt a shift in the willingness of senior Chinese officials to engage in diplomatic talks with geopolitical rivals abroad, and to show more openness on economic policy at home.

The change in tone is particularly visible in China’s relations with the United States. Despite several years of fraying ties and concerted efforts to become less dependent on one another, the two countries remain closely linked economically, together accounting for two-fifths of global output.

In the past month, China has welcomed three senior American officials to Beijing, including John Kerry, President Biden’s climate envoy, who arrived on Sunday, and Treasury Secretary Janet L. Yellen, who held 10 hours of meetings with top Chinese officials. Up to three Chinese ministers are expected to travel to Washington in the coming weeks, as the two countries have begun discussing everything from climate change to military issues.

The Chinese government has also been on a charm offensive directed at domestic and international business leaders.

During the China Development Forum in March and continuing through the World Economic Forum last month in Tianjin, Li Qiang, the country’s premier and second-highest official, offered his personal reassurances that China is open for business.

Mr. Li met last Wednesday with China’s big tech companies to encourage them to hire more workers, in a signal that a nearly three-year push to assert greater political control over the sector may be replaced with an emphasis on economic growth. The powerful National Development and Reform Commission, China’s top economic planning agency, praised the companies the same day for their investments.

“China’s decision making is as hidden from our view as it has ever been, but China’s economic weakness is obvious for all to see, even China’s leaders, which can’t help but be one source of the recent moderation in foreign policy and willingness to engage Washington,” said Scott Kennedy, a China specialist at the Center for Strategic and International Studies in Washington.

Still, analysts noted that any softening in approach remained limited to economic or business policies that do not involve China’s national security, which has become a defining feature of Chinese policy in recent years. And there are few signs that the top leader, Xi Jinping, has endorsed a broad policy shift toward the United States, a step that would be necessary for any change to take root.

On Saturday China announced that it would hold joint naval and air force exercises with the Russian military in the Sea of Japan. And Mr. Xi himself gave a speech on July 6 urging the military to “break new ground” in war preparedness, warning that “China’s security situation is facing rising instability and uncertainty,” according to the official Xinhua news agency.

China has also taken steps this month that could undermine its reputation as a reliable link in global supply chains. It said it would limit exports of rare materials needed to make semiconductors, in a step widely seen as retaliation for American limits on the sale of advanced semiconductors to China.

“Domestic risks are primary, so he’s not looking to take on more risks,” said Jessica Chen Weiss, a Cornell University political scientist specializing in Sino-American relations. “But if he’s punched, he’s going to punch back.”

Mao Ning, a Chinese foreign ministry spokeswoman, said at the ministry’s daily briefing on Monday that China’s economic vitality was undiminished and its development of relations with countries around the world had not changed. “We also hope the U.S. side can work with China to push bilateral relations back to the track of healthy and stable growth,” she said.

Some Chinese experts said they also don’t believe China’s recent economic troubles have constrained the country’s approach to foreign engagement.

Da Wei, the director of the Center for International Security and Strategy at Tsinghua University in Beijing, said the United States was unlikely to change its policies aimed at curbing China’s technology advances. So China has little incentive to make compromises regardless of broader economic issues, he said.

“Talking about the short term, like the recent thaw in relations between the U.S. and China, I don’t think the economy has much effect,” he said.

But for China, the latest batch of data suggests that economic pressures could continue to intrude on geopolitical objectives. A key index of housing prices declined last month, sapping consumers of wealth. Exports — a crucial driver of China’s economy — are suffering.

And the investment picture has gotten murky. American companies have complained that it has become more difficult to do business in China amid the government’s focus on national security. The authorities have conducted raids of firms and detained personnel, particularly among due diligence companies, which multinationals hire to check on Chinese companies that are potential business partners or acquisitions.

The geopolitical environment is central to the decisions that companies and investors make about whether to put money into China or rely on it as a base for exports.

China has a lot at stake economically. Tens of millions of Chinese jobs depend on global trade. Its sales of manufactured goods to other countries are more than triple its purchases of these goods from other countries.

Those critical trade ties extend beyond the United States. China’s tilt toward Russia on the Ukraine war has severely hurt its relations with Europe. China’s exports to the European Union slumped 14.2 percent in June from a year earlier.

The Baltic countries — Lithuania, Latvia and Estonia, all especially hostile to Russia — have quit China’s diplomatic process for talks with Eastern Europe. Lithuania has flirted with closer ties with Taiwan, an island democracy over which Beijing claims sovereignty. China retaliated last year by severely reducing trade with all three Baltic countries, particularly halting almost all imports from Lithuania. That angered the rest of the European Union.

China has tried to patch up frayed ties in the last few months with an even more extensive exchange of top-level visits with countries like France and Germany.

It might be too late. Germany issued a new national strategy last Thursday that called for reducing economic dependence on China and exhorted China to stop using its economic leverage in geopolitics. Germany also pledged close relations with the United States and urged China to distance itself from Russia.

China has relied heavily on interrupting its trade with other countries in the last few years to try to persuade them to accept Beijing’s policies, doing so with Australia after that country suggested an investigation into the origins of the Covid pandemic. But China has actually dropped import prohibitions on a range of Australian goods in recent months.

“As it is now the world’s largest trading nation, China has a special responsibility for making the system work,” said Alan Wolff, a former deputy director general of the World Trade Organization.

Li You contributed research.