The lure of going to work in the US’ information technology (IT) sector is often blamed for causing a brain-drain in India but new research shows it helped power the country’s own IT boom, too.

As computer science-related occupations began to grow in the US in the nineties, the proportion of foreigners in the field grew from 9% in 1994 to 24% in 2012. That spurt was almost entirely driven by Indians drawn by the promise of higher wages for the same work. By 2014, 86% of computer science H-1B visas, used by US tech firms to bring in skilled labour from abroad, had been acquired by Indians, who became a useful pool of English-speaking and highly-skilled labour in an era of technological innovations and increasing software demand.

However, a paper published last month by researchers from the University of Michigan and the Center for Global Development, a Washington DC-based think tank, shows that as more Indian students enrolled in computer science programmes with the hope of working abroad, the cap on H-1B visas meant that many had to stay at home, helping India grow a skilled workforce of its own and boosting its IT sector. Moreover, Indians whose visas had expired after the six-year term often returned to the country, bringing back technological know-how and connections with them. As a result, the researchers say, the presumed brain-drain eventually alchemised into a brain-gain, with India overtaking the US when it came to software exports by 2005. The study used economic models that factored in college choices, wages, visa figures, and IT productivity, based on data from the start of the IT boom in 1994 to 2010.

“Because of the software boom in the US, coupled with its immigration policy, it became an incentive for Indians to acquire the computer science skills valued in the US,” said Gaurav Khanna, an economist at the Center for Global Development who wrote the paper with Nicolas Morales. “If US immigration had been restricted in the 1990s, it would not have allowed the Indian IT sector to develop.”

In India, degrees conferred in science and engineering rose from about 176,000 in 1990 to 455,000 in 2000. Meanwhile, the cap on H-1B visas went from 65,000 at first to 115,000 in 1999; it then rose to 195,000 in 2000 to 2003 before going back to 65,000 from 2004.

“We find that US immigration policy, coupled with the US tech boom, helped develop the Indian IT sector,” the authors write. “This transformation in India boosted IT exports and raised average incomes. The prospect of migrating to the US was a considerable driver of this phenomenon and led to a ‘brain-gain’ that outweighed the negative impacts of ‘brain-drain’.”

Now, as president Donald Trump’s anti-immigrant stance threatens the H-1B visa programme, the IT industry is in for the next stage of transformation. Though the researchers found that the entry of skilled foreign workers in the US reduced the native-born computer science workforce by 9% in 2010, and that the wider pool of computer scientists in India dented wages, they concluded that the way the IT industry developed was ultimately good for both countries.

“Overall, however, world IT output is larger by 0.45% and the combined income of both countries is higher by 0.35% (or about US$17.6 billion) because of the H-1B programme,” write the authors. “We find that the average worker in both the US and India is better off with immigration.”