BEIJING — China’s president, Xi Jinping, warned Taiwan that unification must be the ultimate goal of any talks over its future and that efforts to assert full independence could be met by armed force, laying out an unyielding position on Wednesday in his first major speech about the contested island democracy.

Mr. Xi outlined his stance one day after Taiwan’s president, Tsai Ing-wen, urged China to peacefully settle disputes over the island, whose 23 million people, she said, want to preserve their self-rule. But Beijing treats Taiwan as an illegitimate breakaway from Chinese rule, and Mr. Xi said unification was unstoppable as China rose.

“The country is growing strong, the nation is rejuvenating and unification between the two sides of the strait is the great trend of history,” Mr. Xi told officials, military officers and guests in the Great Hall of the People in central Beijing.

China would respect the Taiwanese people’s religious and legal freedoms in a unified “one country, two systems” framework, Mr. Xi said. But he warned that the profound political differences between Taiwan, a vibrant democracy, and China, a highly authoritarian government, were no excuse to reject unification.

“Different systems are not an obstacle to unification, and even less are they an excuse for separatism,” Mr. Xi said. “The private property, religious beliefs and legitimate rights and interests of Taiwanese compatriots will be fully assured.”

Mr. Xi also accompanied his offer of talks with a warning — one implicitly also aimed at the United States, which provides Taiwan with military equipment and the possibility of support in a crisis.

“We make no promise to abandon the use of force, and retain the option of taking all necessary measures,” Mr. Xi said in a section of the speech that drew rousing applause. Those options, he said, could be used against “intervention by external forces.”

The diverging positions staked out by Mr. Xi and Ms. Tsai have brought into focus how the disputed future of Taiwan remains a volatile question that could erupt into crisis, especially if either side misjudges the intentions of the other — or of the United States, a key ally that has strengthened support for Taiwan.

Taiwan’s Mainland Affairs Council, which handles relations with China, said it did not have an immediate comment on Mr. Xi’s speech.

Mr. Xi’s offer of dialogue appeared unlikely to win over Taiwanese wary of the idea that they could retain autonomy under China’s principle of “one country, two systems,” Yun Sun, a researcher on Chinese policy at the Stimson Center in Washington, said by email after the speech.

“Xi is correct in that differences in political systems are the root of the problem,” Ms. Sun said. “But ‘one country, two systems’ is unlikely to be the answer the Taiwanese people embrace.”

Mr. Xi’s speech was a sharp reminder that, even amid many other external disputes, Chinese leaders remain preoccupied with Taiwan, especially their concern that the island could defy their demands and embrace formal independence.

China is Taiwan’s biggest trade partner, taking over 30 percent of its exports. Many Taiwanese, though, bridle at Beijing using its growing influence to isolate them from international participation, and to press them toward eventually accepting Chinese sovereignty over the island.

Since coming to power in late 2012, Mr. Xi has warned Taiwan against any shift toward independence and repeatedly met with Taiwanese politicians from the Kuomintang, the party that ruled China before the Communist Party and that now favors closer ties with Beijing. But Mr. Xi’s address was his first major speech as president devoted to Taiwan, said Bonnie S. Glaser, an expert on Chinese foreign policy at the Center for Strategic and International Studies in Washington.

“My initial impression is that the speech is a reaffirmation of current policy,” Ms. Glaser said. She also noted that despite Mr. Xi’s renewed call for unification, he did not set a deadline. “It is notable that there is no mention of a timetable or deadline for reunification — it is just a goal,” she said.

Mr. Xi indicated that China’s multipronged pressure on Taiwan is likely to persist after Ms. Tsai’s Democratic Progressive Party, which is wary of moving closer to China, suffered stinging setbacks in local Taiwanese elections in November. The opposition Kuomintang won mayoralties in Taiwan’s three most populous cities, prompting Ms. Tsai to resign as leader of the Democratic Progressive Party, though she remains Taiwan’s president.

Chinese state-run media have depicted the election reversals as a vindication of Mr. Xi’s approach to Taiwan: a battery of measures to isolate Taiwan and undercut its international standing since Ms. Tsai won the presidency in 2016.

Taiwan’s status has been contested by Communist leaders since 1949, when Kuomintang forces defeated in the revolution retreated to the island. Tensions have resurged since the 1990s, when Taiwan became a democracy and many voters on the island turned to politicians who argue that Taiwan should keep China at a distance, or even assert outright independence.

Ms. Tsai’s Democratic Progressive Party has been at the forefront of those independence-leaning views, and after she won power, China quickly cut high-level contacts, arguing that Ms. Tsai had failed to acknowledge that Taiwan and China are part of the same country.

In the past three years, China has accelerated efforts to peel away countries from the list of those that give diplomatic recognition to Taiwan, officially known as the Republic of China. Last spring, the Dominican Republic and Burkina Fasoestablished ties with China, and in August, El Salvador cut diplomatic ties with Taiwan, leaving 17 nations that maintain their diplomatic allegiance with the island.

Mr. Xi’s speech commemorated the 40 years since China laid out a new approach to Taiwan soon after the United States switched diplomatic recognition from Taipei to Beijing at the start of 1979. But the United States has remained Taiwan’s most important partner, and the Trump administration has bolstered some support, to the consternation of Chinese officials.

In March, President Trump signed the Taiwan Travel Act, which encourages official government exchanges between the United States and Taiwan. And in June, the United States dedicated a new $250 million unofficial embassy in Taipei.

On the last day of 2018, Mr. Trump signed into law the Asia Reassurance Initiative Act, which tries to counter China’s growing military influence. The section of the law on Taiwan reiterates American commitment “to counter efforts to change the status quo and to support peaceful resolution acceptable to both sides of the Taiwan Strait.” It also calls on the American president to send high-level officials to Taiwan and to regularly sell arms to the island.

The United States and China have brushed close to military conflict over Taiwan: in the 1950s and in 1996, when President Bill Clinton dispatched two carrier groups to seas off Taiwan after China fired intimidating missiles ahead of a Taiwanese presidential election.

The United States dispatched warships to the Taiwan Strait three times last year to show support for Taiwan. That was done under Defense Secretary Jim Mattis, whose resignation last month has left some question about the Americans’ involvement going forward.

In his speech, Mr. Xi “appears to implicitly make an argument that use of force should be a last resort,” Ms. Glaser said. “Of course, Xi has to leave that option on the table, but he makes clear it is not his preference.”

A version of this article appears in print on , on Page A8 of the New York edition with the headline: Unification Is ‘Great Trend of History,’ Xi Warns Taiwan. Order Reprints | Today’s Paper | Subscribe