LONDON — It was supposed to be an auspicious moment: Prime Minister Theresa May of Britain traveling to India to prepare the ground for what could be the country’s first trade deal after it leaves the European Union, and show that Britain can thrive outside the bloc.

But Mrs. May had barely hit the ground when her aspiration to forge closer ties with one of the world’s fastest-growing economies began to falter over immigration, the same thorny and emotive issue that helped propel Britain’s decision to leave the European Union.

Mrs. May’s three-day visit, which began on Sunday, had been billed as a first test of Britain’s ability to forge new and mutually advantageous trade deals with countries around the world, a way to demonstrate its ability to prosper outside the European single market. But while India is notoriously difficult to please in trade matters, the rocky reception was not an ideal way to start her first trip to India as prime minister.

Specifically, India is complaining about student visas, including a requirement that foreign students from outside the European Union must find a job four months after they finish their studies or face deportation.