When the Chinese action movie “Wolf Warrior II” arrived in theatres, in July, it looked like a standard shoot-’em-up, with a lonesome hero and frequent explosions. Within two weeks, however, “Wolf Warrior II” had become the highest-grossing Chinese movie of all time. Some crowds gave it standing ovations; others sang the national anthem. In October, China selected it as its official entry in the foreign-language category of the Academy Awards. The hero, Leng Feng, played by the action star Wu Jing (who also directed the film), is a veteran of the “wolf warriors,” special forces of the People’s Liberation Army. In retirement, he works as a guard in a fictional African country, on the frontier of China’s ventures abroad. A rebel army, backed by Western mercenaries, attempts to seize power, and the country is engulfed in civil war. Leng shepherds civilians to the gates of the Chinese Embassy, where the Ambassador wades into the battle and declares, “Stand down! We are Chinese! China and Africa are friends.” The rebels hold their fire, and survivors are spirited to safety aboard a Chinese battleship. Leng rescues an American doctor, who tells him that the Marines will come to their aid. “But where are they now?” he asks her. She calls the American consulate and gets a recorded message: “Unfortunately, we are closed.” In the final battle, a villain, played by the American actor Frank Grillo, tells Leng, “People like you will always be inferior to people like me. Get used to it.” Leng beats the villain to death and replies, “That was fucking history.” The film closes with the image of a Chinese passport and the words “Don’t give up if you run into danger abroad. Please remember, a strong motherland will always have your back!” When I moved to Beijing, in 2005, little of that story would have made sense to a Chinese audience. With doses of invention and schmalz, the movie draws on recent events. In 2015, China’s Navy conducted its first international evacuation, rescuing civilians from fighting in Yemen; last year, China opened its first overseas military base, in Djibouti. There has been a deeper development as well. For decades, Chinese nationalism revolved around victimhood: the bitter legacy of invasion and imperialism, and the memory of a China so weak that, at the end of the nineteenth century, the philosopher Liang Qichao called his country “the sick man of Asia.” “Wolf Warrior II” captures a new, muscular iteration of China’s self-narrative, much as Rambo’s heroics expressed the swagger of the Reagan era. Recently, I met Wu Jing in Los Angeles, where he was promoting the movie in advance of the Academy Awards. Wu is forty-three, with short, spiky hair, a strong jaw, and an air of prickly bravado. He was on crutches, the result of “jumping off too many buildings,” he told me, in Chinese. (He speaks little English.) “In the past, all of our movies were about, say, the Opium Wars—how other countries waged war against China,” he said. “But Chinese people have always wanted to see that our country could, one day, have the power to protect its own people and contribute to peace in the world.” As a favored son of China, celebrated by the state, Wu doesn’t complain about censorship and propaganda. He went on, “Although we’re not living in a peaceful time, we live in a peaceful country. I don’t think we should be spending much energy thinking about negative aspects that would make us unhappy. Cherish this moment!” China has never seen such a moment, when its pursuit of a larger role in the world coincides with America’s pursuit of a smaller one. Ever since the Second World War, the United States has advocated an international order based on a free press and judiciary, human rights, free trade, and protection of the environment. It planted those ideas in the rebuilding of Germany and Japan, and spread them with alliances around the world. In March, 1959, President Eisenhower argued that America’s authority could not rest on military power alone. “We could be the wealthiest and the most mighty nation and still lose the battle of the world if we do not help our world neighbors protect their freedom and advance their social and economic progress,” he said. “It is not the goal of the American people that the United States should be the richest nation in the graveyard of history.” Under the banner of “America First,” President Trump is reducing U.S. commitments abroad. On his third day in office, he withdrew from the Trans-Pacific Partnership, a twelve-nation trade deal designed by the United States as a counterweight to a rising China. To allies in Asia, the withdrawal damaged America’s credibility. “You won’t be able to see that overnight,” Lee Hsien Loong, the Prime Minister of Singapore, told me, at an event in Washington. “It’s like when you draw a red line and then you don’t take it seriously. Was there pain? You didn’t see it, but I’m quite sure there’s an impact.” In a speech to Communist Party officials last January 20th, Major General Jin Yinan, a strategist at China’s National Defense University, celebrated America’s pullout from the trade deal. “We are quiet about it,” he said. “We repeatedly state that Trump ‘harms China.’ We want to keep it that way. In fact, he has given China a huge gift. That is the American withdrawal from T.P.P.” Jin, whose remarks later circulated, told his audience, “As the U.S. retreats globally, China shows up.” For years, China’s leaders predicted that a time would come—perhaps midway through this century—when it could project its own values abroad. In the age of “America First,” that time has come far sooner than expected.

Barack Obama’s foreign policy was characterized as leading from behind. Trump’s doctrine may come to be understood as retreating from the front. Trump has severed American commitments that he considers risky, costly, or politically unappealing. In his first week in office, he tried to ban travellers from seven Muslim-majority countries, arguing that they pose a terrorist threat. (After court battles, a version of the ban took effect in December.) He announced his intention to withdraw the U.S. from the Paris Agreement on climate change and from UNESCO, and he abandoned United Nations talks on migration. He has said that he might renege on the Iran nuclear deal, a free-trade agreement with South Korea, and NAFTA. His proposal for the 2018 budget would cut foreign assistance by forty-two per cent, or $11.5 billion, and it reduces American funding for development projects, such as those financed by the World Bank. In December, Trump threatened to cut off aid to any country that supports a resolution condemning his decision to recognize Jerusalem as the capital of Israel. (The next day, in defiance of Trump’s threat, the resolution passed overwhelmingly.) To frame his vision of a smaller presence abroad, Trump often portrays America’s urgent task as one of survival. As he put it during the campaign, “At what point do you say, ‘Hey, we have to take care of ourselves’? So, you know, I know the outer world exists and I’ll be very cognizant of that, but, at the same time, our country is disintegrating.” So far, Trump has proposed reducing U.S. contributions to the U.N. by forty per cent, and pressured the General Assembly to cut six hundred million dollars from its peacekeeping budget. In his first speech to the U.N., in September, Trump ignored its collective spirit and celebrated sovereignty above all, saying, “As President of the United States, I will always put America first, just like you, as the leaders of your countries, will always and should always put your countries first.” China’s approach is more ambitious. In recent years, it has taken steps to accrue national power on a scale that no country has attempted since the Cold War, by increasing its investments in the types of assets that established American authority in the previous century: foreign aid, overseas security, foreign influence, and the most advanced new technologies, such as artificial intelligence. It has become one of the leading contributors to the U.N.’s budget and to its peacekeeping force, and it has joined talks to address global problems such as terrorism, piracy, and nuclear proliferation. And China has embarked on history’s most expensive foreign infrastructure plan. Under the Belt and Road Initiative, it is building bridges, railways, and ports in Asia, Africa, and beyond. If the initiative’s cost reaches a trillion dollars, as predicted, it will be more than seven times that of the Marshall Plan, which the U.S. launched in 1947, spending a hundred and thirty billion, in today’s dollars, on rebuilding postwar Europe. China is also seizing immediate opportunities presented by Trump. Days before the T.P.P. withdrawal, President Xi Jinping spoke at the World Economic Forum, in Davos, Switzerland, a first for a paramount Chinese leader. Xi reiterated his support for the Paris climate deal and compared protectionism to “locking oneself in a dark room.” He said, “No one will emerge as a winner in a trade war.” This was an ironic performance—for decades, China has relied on protectionism—but Trump provided an irresistible opening. China is negotiating with at least sixteen countries to form the Regional Comprehensive Economic Partnership, a free-trade zone that excludes the United States, which it proposed in 2012 as a response to the T.P.P. If the deal is signed next year, as projected, it will create the world’s largest trade bloc, by population. Some of China’s growing sway is unseen by the public. In October, the World Trade Organization convened ministers from nearly forty countries in Marrakech, Morocco, for the kind of routine diplomatic session that updates rules on trade in agriculture and seafood. The Trump Administration, which has been critical of the W.T.O., sent an official who delivered a speech and departed early. “For two days of meetings, there were no Americans,” a former U.S. official told me. “And the Chinese were going into every session and chortling about how they were now guarantors of the trading system.” By setting more of the world’s rules, China hopes to “break the Western moral advantage,” which identifies “good and bad” political systems, as Li Ziguo, at the China Institute of International Studies, has said. In November, 2016, Meng Hongwei, a Chinese vice-minister of public security, became the first Chinese president of Interpol, the international police organization; the move alarmed human-rights groups, because Interpol has been criticized for helping authoritarian governments target and harass dissidents and pro-democracy activists abroad. By some measures, the U.S. will remain dominant for years to come. It has at least twelve aircraft carriers. China has two. The U.S. has collective defense treaties with more than fifty countries. China has one, with North Korea. Moreover, China’s economic path is complicated by heavy debts, bloated state-owned enterprises, rising inequality, and slowing growth. The workers who once powered China’s boom are graying. China’s air, water, and soil are disastrously polluted. And yet the gap has narrowed. In 2000, the U.S. accounted for thirty-one per cent of the global economy, and China accounted for four per cent. Today, the U.S.’s share is twenty-four per cent and China’s fifteen per cent. If its economy surpasses America’s in size, as experts predict, it will be the first time in more than a century that the world’s largest economy belongs to a non-democratic country. At that point, China will play a larger role in shaping, or thwarting, values such as competitive elections, freedom of expression, and an open Internet. Already, the world has less confidence in America than we might guess. Last year, the Pew Research Center asked people in thirty-seven countries which leader would do the right thing when it came to world affairs. They chose Xi Jinping over Donald Trump, twenty-eight per cent to twenty-two per cent. Facing criticism for his lack of interest in global leadership, Trump, in December, issued a national-security strategy that singled out China and Russia and declared, “We will raise our competitive game to meet that challenge, to protect American interests, and to advance our values.” But, in his speech unveiling the strategy, he hailed his pullout from “job-killing deals such as the Trans-Pacific Partnership and the very expensive and unfair Paris climate accord.” The next day, Roger Cohen, of the Times, described the contradictions of Trump’s foreign policy as a “farce.” Some allies have taken to avoiding the Administration. “I’ll tell you, honestly, for a foreigner, in the past we were used to going to the White House to get our work done,” Shivshankar Menon, India’s former foreign secretary and national-security adviser to the Prime Minister, told me. “Now we go to the corporations, to Congress, to the Pentagon, wherever.” On his recent visit to Washington, Prime Minister Lee, of Singapore, said that the rest of the world can no longer pretend to ignore the contrasts between American and Chinese leadership. “Since the war, you’ve held the peace. You’ve provided security. You’ve opened your markets. You’ve developed links across the Pacific,” he said. “And now, with a rising set of players on the west coast of the Pacific, where does America want to go? Do you want to be engaged?” He went on, “If you are not there, then everybody else in the world will look around and say, I want to be friends with both the U.S. and the Chinese—and the Chinese are ready, and I’ll start with them.”

Xi Jinping has the kind of Presidency that Donald Trump might prefer. Last fall, he started his second term with more unobstructed power than any Chinese leader since Deng Xiaoping, who died in 1997. The Nineteenth Party Congress, held in October, had the spirit of a coronation, in which the Party declared Xi the “core leader,” an honor conferred only three other times since the founding of the nation (on Mao Zedong, Deng, and Jiang Zemin), and added “Xi Jinping Thought” to its constitution—effectively allowing him to hold power for life, if he chooses. He enjoys total dominion over the media: at the formal unveiling of his new Politburo, the Party barred Western news organizations that it finds troublesome; when Xi appeared on front pages across the country, his visage was a thing of perfection, airbrushed by Party “news workers” to the sheen of a summer peach. For decades, China avoided directly challenging America’s primacy in the global order, instead pursuing a strategy that Deng, in 1990, called “hide your strength and bide your time.” But Xi, in his speech to the Party Congress, declared the dawn of “a new era,” one in which China moves “closer to center stage.” He presented China as “a new option for other countries,” calling this alternative to Western democracy the zhongguo fang’an, the “Chinese solution.” When I arrived in Beijing a few weeks later, the pipe organ of Chinese propaganda was at full force. The state press ran a profile of Xi that was effusive even by the standards of the form, depicting him as an “unrivalled helmsman,” whose “extensive knowledge of literature and the arts makes him a consummate communicator in the international arena.” The article observed, “Xi treats everyone with sincerity, warmth, attentiveness, and forthrightness.” It quoted a Russian linguist who had translated his Party Congress speech: “I read from morning till midnight, even forgetting to have meals.” Xi has inscribed on his country a rigid vision of modernity. A campaign to clean up “low-end population” has evicted migrant workers from Beijing, and a campaign against dissent has evicted the most outspoken intellectuals from online debate. The Party is reaching deeper into private institutions. Foreign universities with programs in China, such as Duke, have been advised that they must elevate a Communist Party secretary to a decision-making role on their local boards of trustees. The Party is encouraging dark imaginings about the outside world: posters warn the public to “protect national secrets” and to watch out for “spies.” Beijing is more convenient than it was not long ago, but also less thrilling; it has gained wealth but lost some of its improvisational energy. Until recently, Chinese nationalists were crowded out by a widespread desire to be embraced by the outside world. They see the parallel ascents of Xi and Trump as cause for celebration, and accuse “white lotuses,” their term for Chinese liberals, of sanctimony and intolerance. They reject political correctness in issues of race and worry about Islamic extremism. (Muslims, though they make up less than two per cent of China’s population, are the objects of fevered animosity on its Internet.) Last June, Yao Chen, one of China’s most popular actresses, received a barrage of criticism online after she tried to raise awareness of the global refugee crisis. (She was forced to clarify that she was not calling for China to accept refugees.) Back in 2008, I met a jittery young conservative named Rao Jin, a contrarian on the fringes of Chinese politics. Long before Trump launched his campaign or railed against the media, Rao created a Web site called Anti-CNN.com, which was dedicated to criticizing Western news coverage. Over lunch in Beijing recently, he exuded calm vindication. “Things that we used to push are now mainstream,” not only in China but globally, he said. In Rao’s view, Trump’s “America First” slogan is an honest declaration, a realist vision stripped of false altruism and piety. “From his perspective, America’s interests come first,” Rao said. “To Chinese people, this is a big truth, and you can’t deny it.” Rao has watched versions of his ideas gain strength in Russia, France, Great Britain, and the United States. “In this world, power speaks,” he said, making a fist, a gesture that Trump adopted in his Inauguration speech and Xi displayed in a photo taken at the start of his new term. China’s leaders rarely air their views about an American President, but well-connected scholars—the ranking instituteniks of Beijing and Shanghai and Guangzhou—can map the contours of their assessments. Yan Xuetong is the dean of Tsinghua University’s Institute of Modern International Relations. At sixty-five, Yan is bouncy and trim, with short silver hair and a roaring laugh. When I arrived at his office one evening, he donned a black wool cap and coat, and we set off into the cold. Before I could ask a question, he said, “I think Trump is America’s Gorbachev.” In China, Mikhail Gorbachev is known as the leader who led an empire to collapse. “The United States will suffer,” he warned. Over a dinner of dumplings, tofu, and stir-fried pork, Yan said that America’s strength must be measured partly by its ability to persuade: “American leadership has already dramatically declined in the past ten months. In 1991, when Bush, Sr., launched the war against Iraq, it got thirty-four countries to join the war effort. This time, if Trump launched a war against anyone, I doubt he would get support from even five countries. Even the U.S. Congress is trying to block his ability to start a nuclear war against North Korea.” For Chinese leaders, Yan said, “Trump is the biggest strategic opportunity.” I asked Yan how long he thought the opportunity would last. “As long as Trump stays in power,” he replied.

The leadership in Beijing did not always have this view of Trump. In the years leading up to the 2016 election, it had adopted a confrontational posture toward the United States. Beijing worked with Washington on climate change and on the Iran nuclear deal, but tensions were building: China was hacking U.S. industrial secrets, building airports on top of reefs and rocks in the South China Sea, creating obstacles for American firms investing in China, blocking American Internet businesses, and denying visas to American scholars and journalists. During the campaign, China specialists in both parties called on the next President to strengthen alliances across Asia and to step up pressure on Beijing. When Trump won, the Party “was in a kind of shock,” Michael Pillsbury, a former Pentagon aide and the author of “The Hundred-Year Marathon,” a 2015 account of China’s global ambitions, told me. “They feared that he was their mortal enemy.” The leadership drafted potential strategies for retaliation, including threatening American companies in China and withholding investment from the districts of influential members of Congress. Most of all, they studied Trump. Kevin Rudd, the former Prime Minister of Australia, who is in contact with leaders in Beijing, told me, “Since the Chinese were stunned that Trump was elected, they were intrinsically respectful of how he could’ve achieved it. An entire battery of think tanks was set to work, to analyze how this had occurred and how Trump had negotiated his way through to prevail.” Before he entered the White House, China started assembling a playbook for dealing with him. Shen Dingli, a foreign-affairs specialist at Fudan University, in Shanghai, explained that Trump is “very similar to Deng Xiaoping,” the pragmatic Party boss who opened China to economic reform. “Deng Xiaoping said, ‘Whatever can make China good is a good “ism.” ’ He doesn’t care if it’s capitalism. For Trump, it’s all about jobs,” Shen said. The first test came less than a month after the election, when Trump took a call from Taiwan’s President, Tsai Ing-wen. “Xi Jinping was angry,” Shen said. “But Xi Jinping made a great effort not to create a war of words.” Instead, a few weeks later, Xi revealed a powerful new intercontinental ballistic missile. “It sends a message: I have this—what do you want to do?” Shen said. “Meantime, he sends Jack Ma”—the founder of the e-commerce giant Alibaba—“to meet with Trump in New York, offering one million jobs through Alibaba.” Shen went on, “China knows Trump can be unpredictable, so we have weapons to make him predictable, to contain him. He would trade Taiwan for jobs.” Inside the new White House, there were two competing strategies on China. One, promoted by Stephen Bannon, then the chief strategist, wanted the President to take a hard line, even at the risk of a trade war. Bannon often described China as a “civilizational challenge.” The other view was associated with Jared Kushner, Trump’s son-in-law and adviser, who had received guidance from Henry Kissinger and met repeatedly with the Chinese Ambassador, Cui Tiankai. Kushner argued for a close, collegial bond between Xi and Trump, and he prevailed. He and Rex Tillerson, the Secretary of State, arranged for Trump and Xi to meet at Mar-a-Lago on April 7th, for a cordial get-to-know-you summit. To set the tone, Trump presented two of Kushner and Ivanka Trump’s children, Arabella and Joseph, who sang “Jasmine Flower,” a classic Chinese ballad, and recited poetry. While Xi was at the resort, the Chinese government approved three trademark applications from Ivanka’s company, clearing the way for her to sell jewelry, handbags, and spa services in China. Kushner has faced scrutiny for potential conflicts of interest arising from his China diplomacy and his family’s businesses. During the transition, Kushner dined with Chinese business executives while the Kushner Companies was seeking their investment in a Manhattan property. (After that was revealed in news reports, the firm ended the talks.) In May, Kushner’s sister, Nicole Kushner Meyer, was found to have mentioned his White House position while she courted investors during a trip to China. The Kushner Companies apologized. During the Mar-a-Lago meetings, Chinese officials noticed that, on some of China’s most sensitive issues, Trump did not know enough to push back. “Trump is taking what Xi Jinping says at face value—on Tibet, Taiwan, North Korea,” Daniel Russel, who was, until March, the Assistant Secretary of State for East Asian and Pacific Affairs, told me. “That was a big lesson for them.” Afterward, Trump conceded to the Wall Street Journal how little he understood about China’s relationship to North Korea: “After listening for ten minutes, I realized it’s not so easy.” Russel spoke to Chinese officials after the Mar-a-Lago visit. “The Chinese felt like they had Trump’s number,” he said. “Yes, there is this random, unpredictable Ouija-board quality to him that worries them, and they have to brace for some problems, but, fundamentally, what they said was ‘He’s a paper tiger.’ Because he hasn’t delivered on any of his threats. There’s no wall on Mexico. There’s no repeal of health care. He can’t get the Congress to back him up. He’s under investigation.” After the summit, the Pangoal Institution, a Beijing think tank, published an analysis of the Trump Administration, describing it as a den of warring “cliques,” the most influential of which was the “Trump family clan.” The Trump clan appears to “directly influence final decisions” on business and diplomacy in a way that “has rarely been seen in the political history of the United States,” the analyst wrote. He summed it up using an obscure phrase from feudal China: jiatianxia—“to treat the state as your possession.”

After Mar-a-Lago, Trump heaped praise on Xi. “We had a great chemistry, I think. I mean, at least I had a great chemistry—maybe he didn’t like me, but I think he liked me,” he said on the Fox Business Network. Meanwhile, Chinese analysts were struggling to keep up with the news about the rise and fall of White House advisers. Following a report that Tillerson had disparaged the President’s intelligence, Shen, of Fudan University, asked me, “What is a moron?” By early November, Trump was preparing for his first trip to Beijing. Some China specialists in the U.S. government saw it as a chance to press on substantive issues. “We have to start standing up for our interests, because they have come farther, and faster, than people thought, pretty much without anyone waking up to it,” a U.S. official involved in planning the visit told me. Among other things, the U.S. wanted China to open up areas of its economy, such as cloud computing, to foreign competitors; crack down on the theft of intellectual property; and stop forcing American firms to transfer technology as a condition for entry to the Chinese market. “It is time for a sense of urgency,” the official said. Cui Tiankai, the Chinese Ambassador to Washington, billed Trump’s visit as a “state visit plus.” An American with high-level contacts in Beijing told me that they planned to “wow him with five thousand years of Chinese history. They believe he is uniquely susceptible to that.” The strategy had worked before. In the mid-nineteen-eighties, the C.I.A. commissioned a China scholar named Richard Solomon to write a handbook for American leaders, “Chinese Political Negotiating Behavior.” Solomon, whose study was later declassified, noted that some of China’s most effective techniques were best described in the nineteenth century, when a Manchu prince named Qiying recorded his preferred approach. “Barbarians,” Qiying noted, respond well to “receptions and entertainment, after which they have had a feeling of appreciation.” Solomon warned that modern Chinese leaders “use the trappings of imperial China” to “impress foreign officials with their grandeur and seriousness of purpose.” Solomon advised, “Resist the flattery of being an ‘old friend’ or the sentimentality that Chinese hospitality readily evokes.” (Henry Kissinger, he wrote, once gushed to his hosts, “After a dinner of Peking duck I’ll agree to anything.”) Following the Nineteenth Party Congress, Trump marvelled at Xi’s new power. “Now some people might call him the king of China,” he told an interviewer, shortly before his trip. Trump arrived in more modest standing. A few hours before his plane touched down, on November 8th, Republicans were thumped in state elections, losing governors’ races in Virginia and New Jersey. His approval rating was thirty-seven per cent, the lowest of any President at that point in his tenure since Gallup started measuring it. Three former aides had been charged with felonies in the investigation into Russian interference in the 2016 election. It was the first summit since 1972 in which the American President had less leverage and political security than his Chinese counterpart. Xi deftly flattered his guest. Upon Trump’s arrival, they took a sunset tour of the Forbidden City. They drank tea, watched an opera performance at the Pavilion of Pleasant Sounds, and admired an antique gold urn. The next morning, at the Great Hall of the People, Trump was greeted by an even more lavish ceremony, with Chinese military bands, the firing of cannons, and throngs of schoolchildren, who waved colored pompoms and yelled, in Chinese, “Uncle Trump!” Government censors struck down critical comments about Trump on social media. Trump and Xi met for several hours and then appeared before the press. “The hosting of the military parade this morning was magnificent,” Trump said, and he praised Xi as a “highly respected and powerful representative of his people.” He mentioned the need to coöperate with regard to North Korea, and to fix an “unfair” trade relationship, but he said nothing about intellectual property or market access. “I don’t blame China,” Trump said. “Who can blame a country for being able to take advantage of another country for the benefit of its citizens?” There were gasps from business leaders and journalists. “I give China great credit.” Some Chinese members of the audience cheered. Xi and Trump took no questions from the press. In preparations for Trump’s meeting with Xi, the State Department had urged the President to bring up a human-rights case: that of the poet Liu Xia, the widow of the late Nobel laureate Liu Xiaobo, who is under house arrest, without charges. According to two U.S. officials, Trump never mentioned it. Trump’s deference to Xi—the tributes and tender musings about chemistry—sent a message to other countries that are debating whether to tilt toward the U.S. or China. Daniel Russel said, “The American President is here. He’s looking in awe at the Forbidden City. He’s looking in awe at Xi Jinping, and he’s choosing China because of its market, because of its power. If you thought that America was going to choose you and these ‘old-fashioned’ treaties and twentieth-century values, instead of Xi Jinping and the Chinese market, well, think again.”

In concrete terms, why does it matter if America retreats and China advances? One realm in which the effects are visible is technology, where Chinese and American companies are competing not simply for profits but also to shape the rules concerning privacy, fairness, and censorship. China bars eleven of the world’s twenty-five most popular Web sites—including Google, YouTube, Facebook, and Wikipedia—because it fears they will dominate local competitors or amplify dissent. The Chinese government has promoted that approach under a doctrine that it calls “cyber-sovereignty.” In December, China hosted an Internet conference that attracted American C.E.O.s such as Tim Cook, of Apple, even though China has forced Apple to remove apps that allow users to circumvent the “Great Firewall.” In Beijing, I hailed a cab and headed to the northwest corner of the city, where a Chinese company called SenseTime is working on facial recognition, a field at the intersection of science and individual rights. The company was founded in 2014 by Tang Xiao’ou, a computer scientist who trained at M.I.T. and returned to Hong Kong to teach. (For years, China’s startups lagged behind those in Silicon Valley. But there is more parity now. Of the forty-one private companies worldwide that reached “unicorn” status in 2017—meaning they had valuations of a billion dollars or more—fifteen are Chinese and seventeen are American.) SenseTime’s offices have a sleek, industrial look. Nobody wears an identification badge, because cameras recognize employees, causing doors to open. I was met there by June Jin, the chief marketing officer, who earned an M.B.A. at the University of Chicago and worked at Microsoft, Apple, and Tesla. Jin walked me over to a display of lighthearted commercial uses of facial-recognition technology. I stepped before a machine, which resembled a slender A.T.M., that assessed my “happiness” and other attributes, guessed that I am a thirty-three-year-old male, and, based on that information, played me an advertisement for skateboarding attire. When I stepped in front of it again, it revised its calculation to forty-one years old, and played me an ad for liquor. (I was, at the time, forty.) The machines are used in restaurants to entertain waiting guests. But they contain a hidden element of artificial intelligence as well: images are collected and compared with a facial database of V.I.P. customers. “A waiter or waitress comes up and maybe we get you a seat,” Jin said. “That’s the beauty of A.I.” Next, Jin showed me how the technology is used by police. She said, “We work very closely with the Public Security Bureau,” which applies SenseTime’s algorithms to millions of photo I.D.s. As a demonstration, using the company’s employee database, a video screen displayed a live feed of a busy intersection nearby. “In real time, it captures all the attributes of the cars and pedestrians,” she said. On an adjoining screen, a Pac-Man-like trail indicated a young man’s movements around the city, based only on his face. Jin said, “It can match a suspect with a criminal database. If the similarity level is over a certain threshold, then they can make an arrest on the spot.” She continued, “We work with more than forty police bureaus nationwide. Guangdong Province is always very open-minded and embracing technology, so, last year alone, we helped the Guangdong police bureau solve many crimes.” In the U.S., where police departments and the F.B.I. are adopting comparable technology, facial recognition has prompted congressional debates about privacy and policing. The courts have yet to clarify when a city or a company can track a person’s face. Under what conditions can biometric data be used to find suspects of a crime, or be sold to advertisers? In Xi Jinping’s China, which values order over the rights of the individual, there are few such debates. In the city of Shenzhen, the local government uses facial recognition to deter jaywalkers. (At busy intersections, it posts their names and I.D. pictures on a screen at the roadside.) In Beijing, the government uses facial-recognition machines in public rest rooms to stop people from stealing toilet paper; it limits users to sixty centimetres within a nine-minute period. Before Trump took office, the Chinese government was far outspending the U.S. in the development of the types of artificial intelligence with benefits for espionage and security. According to In-Q-Tel, an investment arm of the United States intelligence community, the U.S. government spent an estimated $1.2 billion on unclassified A.I. programs in 2016. The Chinese government, in its current five-year plan, has committed a hundred and fifty billion dollars to A.I. The Trump Administration’s proposed 2018 budget would cut scientific research by fifteen per cent, or $11.1 billion. That includes a ten-per-cent decrease in the National Science Foundation’s spending on “intelligent systems.” In November, Eric Schmidt, then the chairman of Alphabet, told the Artificial Intelligence & Global Security Summit, in Washington, that reductions in the funding of basic-science research will help China overtake the U.S. in artificial intelligence within a decade. “By 2020, they will have caught up. By 2025, they will be better than us. By 2030, they will dominate the industries of A.I.,” he said. Schmidt, who chairs the Defense Innovation Advisory Board, added that the ban on visitors from Iran was an obstacle to technology development. “Iran produces some of the top computer scientists in the world. I want them here. I want them working for Alphabet and Google. It’s crazy not to let these people in.”

China’s effort to extend its reach has been so rapid that it is fuelling a backlash. Australian media have uncovered efforts by China’s Communist Party to influence Australia’s government. In December, Sam Dastyari, a member of the Australian Senate, resigned after revelations that he warned one of his donors, a businessman tied to China’s foreign-influence efforts, that his phone was likely tapped by intelligence agencies. Australia’s Prime Minister, Malcolm Turnbull, announced a ban on foreign political donations, citing “disturbing reports about Chinese influence.” In August, Cambridge University Press, in Britain, caused an uproar among scholars after it removed from one of its Chinese Web sites more than three hundred academic articles that mentioned sensitive topics, such as the crackdown at Tiananmen Square, in an effort to satisfy China’s censors. Cambridge abandoned the move. (Another academic publisher, Springer Nature, defended its decision to censor itself, saying that it was necessary “to prevent a much greater impact on our customers and authors.”) Foreign governments and human-rights groups have expressed alarm that Beijing is pursuing critics beyond its borders and bringing them to mainland China for detention. One night last January, unidentified men escorted a Chinese-Canadian billionaire, Xiao Jianhua, from a Hong Kong hotel, in a wheelchair, with a sheet over his head. (His whereabouts are unknown.) In several cases, beginning in 2015, the publishers of books critical of China’s leaders were abducted from Hong Kong and Thailand, without public extradition procedures. Across Asia, there is wariness of China’s intentions. Under the Belt and Road Initiative, it has loaned so much money to its neighbors that critics liken the debt to a form of imperialism. When Sri Lanka couldn’t repay loans on a deepwater port, China took majority ownership of the project, stirring protests about interference in Sri Lanka’s sovereignty. China also has a reputation for taking punitive economic action when a smaller country offends its politics. After the Nobel Prize was awarded to the dissident Liu Xiaobo, China stopped trade talks with Norway for nearly seven years; during a territorial dispute with the Philippines, China cut off banana imports; in a dispute with South Korea, it restricted tourism and closed Korean discount stores. In Beijing’s political circles, some strategists worry that their leaders risk moving too fast to fill the void created by America’s withdrawal from its global role. I dropped by to see one of the city’s wisest observers of America, Jia Qingguo, the dean of the Department of Diplomacy at Peking University. “The U.S. is not losing leadership. You’re giving it up. You’re not even selling it,” he said. “It seems Donald Trump’s view is: if China can take a free ride, why can’t we? But the problem is that the U.S. is too big. If you ride for free, then the bus will collapse. Maybe the best solution is for China to help the U.S. drive the bus. The worse scenario is that China drives the bus when it’s not ready. It’s too costly and it doesn’t have enough experience.” Jia, who has a wry smile and a thick head of graying hair, said that universities have not had enough time to train scholars in areas that China is now expected to navigate: “In the past, the outside world was very far away. Now it’s very close. But the change happened too fast to digest.” Joseph Nye, the Harvard political scientist who coined the term “soft power,” to describe the use of ideas and attraction rather than force, told me that China has improved its ability to persuade—up to a point. “American soft power comes heavily from our civil society, everything from Hollywood to Harvard and the Gates Foundation,” he said. “China still doesn’t understand that. They still haven’t opened that up. I think that is going to hurt them in the longer term.” Nye predicts that Trump’s unpopularity will not erase America’s soft-power advantage, except under certain conditions. “Probably he won’t be seen as a turning point in American history but will be seen as a blip, another one of the strange characters that our political process throws up, like Joe McCarthy or George Wallace,” he said. “Two things could make me wrong. One is if he gets us into a major war. The second is if he gets reëlected and winds up doing damage to our checks and balances or our reputation as a democratic society. I don’t think those are likely, but I don’t have enough confidence in my judgment to assure you.” At the White House, aides said that late last year a two-tiered strategy took hold, in which the President will seek to maintain congenial relations with Xi while lower-ranking officials introduce hard-line measures. By the end of 2017, the State Department, the National Security Council, and other agencies were considering policies to push back on China’s influence operations, trade practices, and efforts to shape the technology of the future. Michael Green, who was George W. Bush’s chief adviser on Asia, told me, “They’re looking at it like it’s a war plan: working with the allies, working with members of Congress.” In its national-security strategy, the Administration suggested that, to stop the theft of trade secrets, it could restrict visas to foreigners who travel to the U.S. to study science, engineering, math, and technology; it dedicated itself to a “free and open Indo-Pacific,” which, in practice, will likely expand military coöperation with India, Japan, and Australia. Robert Lighthizer, the U.S. Trade Representative, is considering several potential tariffs in order to punish China for its alleged theft of intellectual property and dumping of exports on U.S. markets. “We’re not looking for a trade war,” a senior White House official involved in China issues told me. “But the President fully believes that we have to stand up to China’s predatory industrial policies that have hollowed out U.S. manufacturing and, increasingly, high-tech sectors.” If the White House takes such actions, they could collide with Trump’s admiring relationship with Xi. In the meantime, many China specialists describe the Administration’s approach as inchoate. In the first eleven months of Trump’s Presidency, none of his Cabinet secretaries had given a major speech on China. The post of Assistant Secretary of State for East Asian and Pacific Affairs, the State Department’s top job for the region—once held by W. Averell Harriman, Richard Holbrooke, and Christopher Hill—remained unfilled. David Lampton, the director of China studies at the School of Advanced International Studies, at Johns Hopkins, told me, “I think this is like a bunch of drunks in a car fighting for the steering wheel.”