Malaysia’s deal to buy Chinese naval ships and step up patrols against any intrusions from China underscores the complexity of relations between the two countries and signals growing concern over national defense.

Officials from the Southeast Asian country, with a coastline stretching from the Sulu Sea westward to the Indian Ocean, said in November they would get four littoral mission ships made in China.

Littoral mission ships are relatively small vessels designed in the past for stealth combat near coastlines, sometimes against bigger enemies.

Upgrade aging fleet

Analysts say those ships would head up the replacement of 50 vessels in the Royal Malaysian Navy to protect its waters from a list of threats. Among them is China, which competes with Malaysia for claims to the shared South China Sea.

“China, when their vessels patrol the nine-dash line, that brings them very close to Malaysian shores,” said Ibrahim Suffian, program director with the Kuala Lumpur-based polling group Merdeka Center. He was referring to a line China uses to delineate a maritime claim extending from its southern coast almost to Indonesia.

“The prime minister announced the agreement with China last year, for four littoral vessels,” he said. “In the past the Malaysian armed forces have typically favored Western equipment, whether from the U.S., the U.K. or France, so this marks a departure from the practice.”

Malaysian backlash

In 2015, the country spotted a Chinese coast guard ship anchored at Luconia Shoals, which are tiny South China Sea land forms about 150 kilometers north of Malaysian Borneo. A Chinese naval vessel had been seen earlier near Malaysia, and in March 2016 Malaysia spotted 100 Chinese fishing boats escorted by Beijing’s coast guard.

Some in the country of 31 million people feel their government reacts weakly to China’s ship movements, a perception that has threatened the ruling party’s reputation, said Collin Koh, maritime security research fellow at Nanyang Technological University in Singapore.

“If you look at what happened in September 2015, when they had the first revelations about this Chinese coast guard vessel stationed off Luconia Shoal, there was quite a public backlash because people were questioning how come the Malaysian government allowed the coast guard vessel to be there,” Koh said.

The government of Prime Minister Najib Razak felt “there must be something done at least to appease the public and to show the public that something is really done and they are serious about it,” he said.

Valuable economic partner

Malaysia usually avoids poking China directly because of a valuable economic relationship, analysts say. Malaysia counts China, the world’s second largest economy, as its top trading partner and leading source of direct foreign investment.

China uses its economic influence elsewhere in Southeast Asia, most recently in the Philippines, in exchange for tolerance of its activities in the disputed sea.

China maintains the world’s third strongest military compared to Malaysia at No. 34, according to the database GlobalFirePower.com.

“No matter how much Malaysia is going to upgrade the navy, it’s not going to catch up with China’s naval expansion by a far stretch,” said Oh Ei Sun, international studies instructor at Singapore Nanyang University.

South China Sea Territorial Claims

Beijing claims about 95 percent of the 3.5 million-square-kilometer South China Sea, covering fishery-rich waters that Malaysia, Brunei, Taiwan, Vietnam and the Philippines also claim.

China has stepped up defense of its maritime claims since 2010. Its coast guard, fishing vessels and oil rigs pop up in waters that overlap the exclusive economic zones of other countries as it landfills islets that other claimants call their own.

But Malaysia sits on the most extensive undersea fossil fuel reserves among the South China Sea parties.

Pirates, extremists also threats

In addition to the potential for conflict over maritime disputes, Malaysia needs naval upgrades also to resist violent Muslim groups who try to cross a hard-to-police sea border from the southern Philippines into Borneo, analysts add.

And sea pirates sometimes operate off the north coast of Borneo, pushing the need for authorities to have faster patrol boats, Oh said. In the commercial space, fishing vessels sometimes approach Malaysian waters from Indonesia, Thailand and Vietnam, Suffian added.

But Malaysia cut its defense budget 12.7 percent to $3.41 billion this year, and Koh said some of its ships are 30 to 50 years old, making them “uneconomical to maintain.”