Like many ambitious young scientists, José Pastor-Pareja came to the United States to supercharge his career. At Yale University, he worked in cutting-edge laboratories, collaborated with experts in his field and published in prestigious journals.

But the allure of America soon began to wear off. The Spanish geneticist struggled to renew his visa and was even detained for two hours of questioning at a New York City airport after he returned from a trip abroad. In 2012, he made the surprising decision to leave his Ivy League research position and move to China.

“It is an opportunity not many take,” Pastor-Pareja said. But the perks were hard to resist — a lucrative signing bonus, guaranteed research funding, ample tech staff and the chance to build a genetics research center from scratch.

After decades of American dominance, Chinese science is ascendant, and it is luring scientists like Pastor-Pareja away from the United States. Even more China-born scientists are returning from abroad to a land of new scientific opportunity.

The United States spends half a trillion dollars a year on scientific research — more than any other nation on Earth — but China has pulled into second place, with the European Union third and Japan a distant fourth.

China is on track to surpass the United States by the end of this year, according to the National Science Board. In 2016, annual scientific publications from China outnumbered those from the United States for the first time.

“There seems to be a sea change in how people are talking about Chinese science,” said Alanna Krolikowski, a Chinese science expert at Missouri University of Science and Technology. Foreign observers, many of whom were once condescending, now “are rather in awe at what the Chinese policies have accomplished.”

The scientific advances are a small piece of China’s larger ambitions. President Xi Jinping aims to supplant the United States as the world’s economic superpower within three decades. In October, Xi vowed to produce “a world-class army by 2050.”

Meanwhile, China is spending more on infrastructure than the United States or Europe, and the middle class has ballooned — making relocation more attractive.

“More and more people keep coming, that’s for sure,” Pastor-Pareja said. “Right now, China is the best place in the world to start your own laboratory.”

José Pastor-Pareja in his lab in Beijing. (Yan Cong/For The Washington Post)

Under the Trump administration, many U.S. researchers say their work has been devalued, threatened by budget cuts and hampered by stricter immigration policies that could deter international collaborations and the influx of talent that has long fueled American innovation.

“We are in deep doo-doo for two reasons,” said Denis Simon, who has studied Chinese science for 40 years and is the executive vice chancellor of Duke Kunshan University. In his view, the White House, without a science adviser for more than a year, lacks scientific leadership.

And collaboration between U.S. and Chinese researchers is under threat, he said. Recent restrictions on H-1B visas sent a message to Chinese graduate students that “it’s time to go home when you finish your degree.” Since 1979, China and the United States have maintained a bilateral agreement, the Cooperation in Science and Technology, to jointly study fields like biomedicine and high-energy physics. In the past the agreement was signed as a routine matter, Simon said, but that’s no longer the case.

Pastor-Pareja, the geneticist who gave up Yale for Beijing, specializes in studies of cell biology using fruit flies — Drosophila melanogaster.

The field is struggling in the United States, Pastor-Pareja said, as funding has declined. In China, there are now 30 drosophila laboratories in Beijing, he said — more than in either Boston or San Francisco — and scientists have begun meeting every two months to share their latest work.

“At this rate, China may soon eclipse the U.S.,” Sen. Bill Nelson (D-Fla.) warned at a January congressional hearing on the state of American science, “and we will lose the competitive advantage that has made us the most powerful economy in the world.”

The biggest and fastest

The burgeoning science race is hugely important to China’s leaders, in part because of what it says about the country’s growing global standing. In recent years, the government has invested in scientific endeavors for strategic advantage — and also boasting rights.

China has 202 of the world’s 500 most powerful supercomputers — 60 more systems than in the United States. The largest radio telescope ever built — a massive, 500-meter, $180 million dish called the Aperture Spherical Telescope that hunts for distant black holes — is in the southern province of Guizhou, where its construction required 9,000 Chinese residents to relocate.

President Trump has directed NASA to return astronauts to the moon. But the moon may be crowded when they arrive: Both China and India are planning to launch landers toward the moon this year. China is collaborating with the European Space Agency on a potential moon base.

Last year, Chinese scientists produced “entangled photons,” light particles linked together on a quantum physics level, aboard a satellite in orbit 300 miles up. The particles were beamed to locations on Earth 750 miles apart and remained linked — which could potentially be a step toward a new form of instant and secure communication.

Also last year, biologists in China became the first to successfully clone a monkey using the technique that created Dolly the sheep. Genetically identical primates, their creators said, would speed medical research because the effects of any drug being tested could be traced to the treatment, not differences in genes.

Chinese leaders recently unveiled plans to become the world leader in artificial intelligence, aiming to turn the field into a $150 billion industry by 2030. Already, China’s artificial intelligence boom has led to advanced facial recognition. At a KFC restaurant in the eastern city of Hangzhou, for example, customers can now pay for their fried chicken using a machine that scans their faces. Baidu, China’s search-engine giant, plans to partner with an airport to roll out facial recognition for airline passengers this year.

Growing from stumps

The recent scientific advancements are especially notable, given China’s fraught history. Its scientific community was devastated during the 1966-1976 Cultural Revolution, when academics were denounced as “counterrevolutionary” and universities were closed, halting almost all research and scientific training.

Only with the death of Mao Zedong in 1976 did China’s research community begin to regrow around its stumps. In the following decades, China’s leaders tackled their lagging status with a method their authoritarian Communist Party has become known for: top-down, long-term strategic planning.

During the early 2000s, party leaders declared an ambitious 15-year goal of devoting 2.5 percent of China’s total gross domestic product to scientific research and development by 2020. They enacted rules that required Western companies, hungry for access to China’s market, to share technology with their Chinese counterparts. According to U.S. agencies, China’s military and intelligence agencies also stole research from key U.S. technology companies and sectors.

In 2015, Li Keqiang, the Chinese premier, announced “Made in China 2025,” a plan to boost aviation, robotics and other high-tech industries. It recently became a flash point in the trade tensions between the United States and China, when the Trump administration proposed tariffs that target such industries.

Within the scientific community, one of China’s most successful plans has been an aggressive recruiting program called Thousand Talents.

For the past decade, the program has targeted Chinese citizens who have studied at elite universities in the United States and elsewhere. It has lured back these foreign-trained experts by, essentially, throwing money at them. The program has also gone after a smaller number of foreign-born scientists who have won prestigious prizes or made internationally recognized scientific contributions.

One recruit, a Californian chemist named Jay Siegel, became dean of the School of Pharmaceutical Science and Technology at Tianjin University. He encouraged Fraser Stoddart of Northwestern University, who was awarded a Nobel Prize in 2016 for his work with molecular machines, to set up a lab at Tianjin as a visiting professor.

“When the program came out in 2008, it was almost perfect timing because of the global economic crisis,” said Cong Cao, who studies Chinese science policy at the University of Nottingham in Ningbo, China. “It’s now been so successful, the program has almost overachieved.”

The program has brought more than 7,000 scientists and entrepreneurs to China, the government says. They are given a $160,000 signing bonus, and the government often guarantees research funding for years to come. Foreign-born scientists often get additional perks, like subsidies for housing, meals, relocation, additional bonuses from their provincial government, guaranteed jobs for spouses and regular trips back home.

China’s growing attraction for scholars was clear when Duke University decided to open a new joint graduate and research university with Wuhan University in China’s Hubei province in 2013, and applicants for the first few faculty positions quickly overran expectations.

“We were looking for 20 people. We got 1,300 applications,” said Simon, the Duke Kunshan University chancellor. “People from all over the world expressed interest.”

At the same time, China has been ramping up the quantity and quality of its homegrown talent. According to National Science Foundation statistics, China has almost caught up to the United States in its annual number of doctoral degrees in science and engineering, with 34,000 vs. the United States’ 40,000.

Among the brightest of those homegrown stars is Zhao Bowen, a Chinese science prodigy who dropped out of high school to start running a genetics lab. Now 25, Zhao has launched a biomedical start-up focused on microbiome research and chose to locate it in Beijing over anywhere else in the world.

“The U.S. used to be the best at supporting fundamental research,” Zhao said in an interview at his lab. He explained that the United States may still lead in education and research, but for entrepreneurs like him, China now offers not just low start-up costs but also often money that can be pumped in from state research institutes.

Between 2000 and 2015, research spending in the United States increased an average of 4 percent annually. China during that time ratcheted up its spending by an average of 18 percent each year.

Quality control

Though China’s trajectory is clear, U.S. and Chinese experts say the country’s scientific community still struggles with significant hurdles.

While China recently surpassed the United States in sheer volume of scientific papers published, U.S. papers were cited by other researchers more often. Facing pressures to publish, some Chinese academics have been known to publish “junk papers” to meet expectations, Chinese and Western scientists say. Last year, 100 scientific papers involving hundreds of Chinese authors were retracted in a major crackdown on publication fraud.

China-based entrepreneurs have applied for a record-setting number of patents, according to the World Intellectual Property Organization, but studies suggest a similar inflation may be going on, and critics have questioned the quality and novelty of many of those applications.

And China’s research culture, which is often dominated like much else in the country by personal and political connections, also continues to pose a barrier at times to recruiting the highest caliber of scientific talent. China also has a much less stringent regulatory system overseeing its research than the United States, where, for example, the Food and Drug Administration reviews research on new drugs and medical devices. Lax regulation often allows Chinese scientists to be quicker in applying powerful biological techniques — like gene therapies — to humans, but it also has cast doubt at times on the ethics and rigor of its research.

Still, China has much to offer the United States, some experts say, and the U.S. government should encourage collaboration, not rivalry. Science is one of the most international human endeavors, the experts add, and it has become increasingly global and cooperative.

Every large-scale scientific accomplishment in modern times — whether sequencing a new genome or identifying a subatomic particle — has involved collaborators from multiple countries.

In fact, American authors of scientific papers are more likely to collaborate with Chinese scientists than with colleagues from any other nation, according to National Science Foundation data.

Leaders in Washington should embrace the cooperative spirit of working scientists, Simon said, rather than treating China as a threat. “The Chinese, for the first time, really have something to offer us,” he said. “It is vitally in the U.S. interest to plug in.”