The U.S. has the upper hand in pivotal emerging technologies like artificial intelligence and quantum computing, in part because American universities and companies boast world-class talent. But experts say its dominance could soon slip.

Why it matters: The country that reigns in AI, 5G or quantum cryptography will likely have a huge military and economic advantage over its adversaries for years to come and will get to shape the technologies as they are implemented the world over.

A new report from the Council on Foreign Relations identifies the areas in which China is rapidly closing the gap with the U.S. "Slowing down China is not enough," says Adam Segal, an expert on emerging technologies and national security at CFR. "The U.S. needs to do significantly more at home."

China is vastly outpacing the U.S. in planning for and investing in critical research, and it is producing more and more top minds in AI and quantum computing. By 2030, China will likely be the world's leading spender on research and development, per the report.

Compare that to the U.S., where the share of government money spent on research has dwindled from 1.1% of GDP to 0.7%. Restoring that to historical levels is crucial, as about a third of patented American inventions in the last decade have leaned on federally funded research, the report notes.

What to watch: The U.S. needs to pull in scientists from around the globe to compete, Segal says. "China is producing 3 times as many STEM graduates at the undergrad level."

But increasingly restrictive immigration rules may keep Chinese scientists — as well as scientists from other foreign countries — at home.

Go deeper: Facebook to buy a leading brain interface startup