At first the Taiwanese soldiers ignored the drones flying from China. Then, as the flights increased, they fired warning shots. Finally, the soldiers shot one into the sea.

In the past month, nearly 30 unarmed drones have buzzed two islands belonging to Taiwan near China’s southern coast. The drones were mostly civilian, or unidentified, but were clearly targeting the garrison of Taiwanese soldiers stationed on the rocky outcrops.

The drones are adding to tensions between the two sides that have escalated in the past month to new highs. China, which claims self-governed Taiwan as its territory, has intensified the presence of its military in the Taiwan Strait, flying jets and sailing ships ever closer to the island, testing its defenses and raising the risk of conflict.

“China is using such harassment to increase pressure, deliberately raising tensions around Taiwan,” said Chieh Chung, an analyst at Taiwan’s National Policy Foundation. “Don’t assume that a civilian drone has nothing to do with military purposes.”

The question is how Taiwan will respond to future Chinese drone flights that might enter its airspace and whether it can deter Beijing without provoking conflict. In the past week, in addition to the usual assortment of warplanes, China’s military sent four drones into airspace near Taiwan, the island’s Defense Ministry said. China flew the TB-001, a combat drone also known as the Twin-Tailed Scorpion, on Thursday, and two reconnaissance drones Friday and Saturday, according to Taiwan.

For China, the military drones could be used to collect intelligence. The civilian drones are a new source of domestic propaganda aimed at undermining Taiwan’s image.

On Chinese social media, photographs taken by one drone showed two Taiwanese soldiers looking surprised and hapless. Some images showed the contrast between the soaring skyscrapers of the Chinese city of Xiamen and the scrappy conditions of the Taiwanese soldiers on the islands. Chinese commentators mocked soldiers for throwing rocks at the drones.

For Taiwan, the drones represent the latest front in China’s mounting campaign of intimidation and psychological warfare, known as “gray zone” tactics. The frequent incursions put pressure on Taiwan’s government to respond firmly. President Tsai Ing-wen has warned China that Taiwan’s military will not stand by in the face of aggression. “We will not provoke disputes, and we will exercise self-restraint, but it does not mean that we will not counter,” she said in a recent speech on the Penghu Islands in the Taiwan Strait.

On Sept. 1, two days after Tsai’s speech, the Taiwanese soldiers downed the civilian drone, a move that was unusual for Taiwan, which has largely been restrained in pushing back against China.

Part of the challenge for Taiwan is that its military is equipped to deal with China’s fighter jets but is not accustomed to such low-level but constant disturbances, said Drew Thompson, a former Pentagon official who specialized in China. When the drones first emerged, Taiwan appeared unprepared and without sufficient equipment in place to counter them.

The army was caught a bit flat-footed,” Thompson said. “Taiwan is still fighting a 20th-century war and needs to be embracing asymmetric strategies of the 21st century.”

After the shoot-down of the drone, Taiwan’s military rushed extra drone jammers — which can disrupt signals of approaching drones — to its bases on Kinmen and Matsu islands, said Maj. Gen. Chang Jun-Shen of the Kinmen Defense Command. The two islands, with substantial garrisons, send soldiers to Shiyu, or Lion Islet, the tiny outlying island where soldiers shot down the drone. Fewer than 20 soldiers are posted on the islet, defense analysts said.

The Chinese drones started buzzing the islands after Beijing conducted its large-scale military exercises against Taiwan in response to House Speaker Nancy Pelosi’s visit early last month.

The drone flights are the latest iteration of “gray zone” tactics China has used over the past few years to try to coerce and unnerve Taiwan into submission, while stopping short of war, analysts say. Such tactics have run the gamut from daily flights by fighter jets over the median line of the Taiwan Strait to cyberattacks on civilian institutions like Taiwan’s Ministry of Foreign Affairs.

China has steadily increased the number of its military flights around Taiwan in an effort to wear down the readiness of Taiwan’s air force, the experts say. Forcing Taiwan’s pilots to scramble their jets constantly, on short notice, leads to fatigue and lower morale.

Taiwan has sought to upgrade its capabilities to address China’s encroachment and worries in Washington that Taiwan needed to do more to bolster its defenses. The Biden administration approved the sale of more than $1.1 billion of military arms, including anti-ship missiles and surveillance radar, to Taiwan this month. In the past, some weapons sales, including during the Trump administration, have been larger. Still, Beijing complained that the package would “severely jeopardize” its relations with the United States and urged Washington to revoke the sale.

Taiwan’s government also recently announced a hefty increase in its annual military budget. The $19 billion budget represented a 13.9% increase over the previous year, compared with increases of an average of less than 4% each prior year since 2017. Some of the money will be spent on new fighter jets, the Defense Ministry said.

In comparison, China announced a military budget of $229 billion earlier this year.

It is clear that drones would have a very large role in any Chinese campaign to conquer Taiwan,” said Lyle Goldstein, director of Asia engagement for Defense Priorities, a Washington research group and a specialist on China’s military. “China has made enormous efforts to integrate drone technology into all parts of the People’s Liberation Army, as well as related services like the People’s Armed Police and the coast guard.”

Some experts said they thought the commercial drones flown late last month were operated by amateurs having a modicum of fun by buzzing the small number of Taiwanese soldiers on the islands and then posting photos on social media.

Thompson, the former Pentagon official, said it seemed unlikely that the civilian drones were organized by China’s People’s Liberation Army, which has typically sought to directly control its operations against Taiwan.

“There is no evidence these commercial drones flown over outlying islands, including Lion Rock, were under military control,” he said.

Other military experts suggested the Chinese military tacitly condoned, or at least tolerated, the flights. Regardless of who sent them, the rising frequency of drones represents a further step on the ladder of escalation between China and Taiwan, said Alan Dupont, a former defense intelligence analyst with the Australian military.

“This is much more serious than it looks,” Dupont said.

How Taiwan responds to the drones matters for the future. If Taiwan shot down a military drone — such as the “Twin-Tailed Scorpion” China sent Thursday — that could give Beijing an opening to claim hostile action and accuse Taiwan of starting a fight, Dupont said.

So far, he noted, the Taiwan military has been exercising restraint; even when it took down the drone, it was following standard protocols.

Chang Yan-ting, a retired deputy commander of Taiwan’s air force, said soldiers shot the drone down because it flew above military posts, ignored warnings and stayed for more than three minutes.

“We gave it time to fly away,” he said. “The army had no choice but to shoot it down.”

At the height of the Cold War, the islands off Xiamen were a high danger point between the United States and China. After Mao Zedong fired artillery in 1958 at the island of Kinmen, then known as Quemoy, military chiefs in Washington threatened to drop small nuclear bombs in retaliation. President Dwight Eisenhower rejected the advice.

But for now, Taiwan’s military could use a softer form of deterrence, said Lee Hsi-min, a former chief of the general staff of Taiwan’s armed forces. He suggested posting signs on the islands criticizing China’s leader to make the Chinese recoil.

The signs would read: “Let’s stand up. All the Chinese people have come to overthrow the authoritarian Xi Jinping.”