Many Western analysts see China’s foreign policy as intransigent, particularly regarding the South China Sea. With a new president in the Philippines and a new president-elect in the United States, is Beijing likely to shift its stance in the region?

My research suggests China is more willing to compromise than we might expect. In recent weeks, Chinese coast guard vessels let Filipino fishermen return to the waters near Scarborough Shoal after boxing them out since 2012.

Why the softer stance on the South China Sea now? For China, conceding smaller (and possibly less critical) territorial claims can serve Beijing’s larger strategic interests. In fact, one analysis shows that Beijing compromised on a majority of its territorial disputes — often to improve ties with its neighbors.

China has been aggressively occupying the South China Sea

Until recently, Beijing had offered few concessions in the South China Sea. After driving Vietnamese troops from several features in the Spratly Islands in 1988, in 1995 China occupied Mischief Reef, also a Filipino claim.

After a standoff at Scarborough Shoal in 2012, Beijing and Manila agreed to mutual withdrawal, but Chinese government vessels kept Filipino fisherman from the area. By 2015, Beijing’s island-building elsewhere in the region transformed several shoals into artificial islands, complete with runways and other facilities.

Under President Benigno Aquino Jr., in January 2013, the Philippines challenged China’s vast South China Sea claim by filing an arbitration case before a U.N. Law of the Sea tribunal. A big concern was that Scarborough Shoal would be the next island-building project. Located within the Philippines exclusive economic zone and only about 123 miles west of Subic naval base, a military base on Scarborough Shoal would extend China’s reach dangerously close to Manila.

The U.S. looks for strategic partners

Washington had already put Beijing on notice. In July 2010, Secretary of State Hillary Clinton stated that “while the United States does not take sides on the competing territorial disputes over land features in the South China Sea … legitimate claims to maritime space in the South China Sea should be derived solely from legitimate claims to land features.” Other U.S. government statements rejected China’s “nine-dash line” claims as inconsistent with international law.

The U.S. policy on the South China Sea called for strengthening partners in Southeast Asia, to balance against China. In 2011, Australia and the United States struck a deal to rotate 2,500 Marines through Darwin. In 2014, the Philippines signed the Enhanced Defense Cooperation Agreement with the United States, which calls for the rotation of U.S. military forces to Filipino military bases. Vietnam also saw Washington’s reassurances as support for Hanoi’s position against China.

The election of Donald Trump as U.S. president-elect is a new factor for the Chinese to consider. Beijing knew, based on Clinton’s past behavior, that as president, she would likely have taken a hard line opposing China’s expansionist policies in the South China Sea. Some analysts speculate that Trump will not challenge the Chinese over maritime matters because he is more interested in engaging the Chinese economically.

Former CIA chief James Woolsey, now a senior adviser for national security to Trump, wrote in the South China Morning Post that while Trump will be more scrupulous about getting involved around the world, the United States is “the holder of the balance of power in Asian and is likely to remain determined to protect its allies against Chinese overreach.”

Is China doing its own rebalancing?

In July 2016, the U.N. tribunal rejected China’s claims and ruled that the Scarborough Shoal blockade was illegal. Beijing rejected the tribunal’s jurisdiction, raising new fears in Southeast Asia that China might look to turn Scarborough Shoal into another artificial island with military capabilities. Even before the decision was announced, some analysts predicted that Beijing’s efforts might backfire, effectively giving the United States a way to rally Southeast Asian states against China.

The June 2016 election of the deeply anti-American Rodrigo Duterte as president of the Philippines provided another twist, effectively giving Beijing an opening for rapprochement. Beijing reacted angrily in July, declaring it would never accept the judgment of the arbitration tribunal, but China then opened the door for negotiations. Duterte responded by sending former president Fidel Ramos to engage the Chinese and set the stage for formal talks.

The Chinese gambit seemed to work. In October 2016, the Chinese and Filipino presidents met for discussions. Beijing rewarded Duterte’s anti-American stance by agreeing to ease off in the Scarborough Shoal.

China’s Foreign Ministry spokesperson concluded that with Duterte’s pro-China policies, “bilateral relations have turned to a new page of all-around improvement. Under such circumstances, it is fully possible for the two countries to return to the track of managing disputes through consultation and focusing on cooperation.” Duterte reciprocated by ordering the end of U.S.-Philippines joint patrols of the South China Sea, maneuvers that had antagonized Beijing.

There’s a parallel effort to improve ties with Malaysia

Beijing’s tactic may be working with Malaysia, too, another country with a territorial dispute with China. Malaysia has welcomed U.S. aircraft carriers and allowed U.S. P-8 Poseidon aircraft to use its bases for South China Sea patrols. Malaysia also has a defense agreement with Singapore, Australia, New Zealand and the United Kingdom.

In June 2016, Kuala Lumpur showed its frustration over China’s behavior in the South China Sea by pushing for an ASEAN statement critical of China that was released — and then retracted following a special ASEAN-China foreign ministers meeting.

As U.S. relations with Malaysia frayed over recent corruption charges by the U.S. Justice Department, Beijing seized the opportunity to improve its own bilateral ties. During Malaysian Prime Minister Najib Razak’s October visit to Beijing, China offered to sell Malaysia fast missile-carrying patrol boats.

Meet the new, friendly neighbor?

In the past, China has successfully used compromise territorial settlements to enhance friendly relations with its neighbors, if not formal alliances. In the late 1950s, Beijing surrendered control over a small offshore island to Vietnam in an effort to remove friction in Sino-Vietnamese relations in the face of a growing American threat along China’s southern border. Again, in the 1970s, when China was worried about the growing Soviet threat, Beijing willingly set aside the Sino-Japanese Senkaku Islands dispute to facilitate the Japan-China Peace and Friendship Treaty that included a specific “anti-hegemony” clause, a clear jab at the Soviet Union.

After the United States pivoted to Asia in 2012 and began to enhance its military alliances and build partnerships in the region, Beijing now seems to be responding by showing some flexibility and willingness to negotiate over disputed territory. If Beijing’s past behavior is any indication, compromise resolutions are possible when they serve Beijing’s larger strategic interests.

Eric Hyer is an associate professor of political science and the coordinator for Asian studies at Brigham Young University. His research focuses on Indo-Pacific security. His most recent book is “The Pragmatic Dragon: China’s Grand Strategy and Boundary Settlements.”