The surgical ward on the third floor of the teaching hospital in Ilorin has 32 beds, three functioning operating theaters and, since August, no resident surgeons. The last two left within a week of each other, one for Saudi Arabia and one for a hospital in Manchester.

“I have 14 consultants on paper. I have six who come to work,” said Dr. Folasade Adewumi, the hospital’s chief medical director. “The others are abroad, on leave without pay, or waiting for a visa. I schedule surgeries on hope.”

Nigeria’s medical schools graduate about 4,000 doctors a year. The Medical and Dental Council of Nigeria estimates that at least 2,800 of those trained in the past five years now practice abroad, mainly in Britain, the United States, Canada and the Gulf. The country of 230 million people has roughly 45,000 doctors in active practice, about one for every 5,000 residents, a fifth of the ratio the World Health Organization considers a minimum.

On Oct. 1 the federal government began enforcing a measure that has divided the profession. New graduates must now complete five years of service in Nigeria, including two in a rural or underserved area, before the council will issue the certificate of good standing that foreign regulators require to recognize their training. The government has paired the rule with a rural service bonus of 350,000 naira a month, about $230, on top of a base salary that has roughly doubled since 2023.

The Nigerian Medical Association called the rule “bonded labor” and has threatened a strike. Younger doctors say it ignores why they leave. “It is not only the money,” said Dr. Chukwuemeka Nnamdi, 29, who finished his house job in Ilorin in July and is applying for a residency in Toronto. “It is operating by torchlight because the generator is out of diesel. It is being attacked by relatives when a patient dies because there was no blood. Five years of that is not a service. It is a sentence.”

Supporters argue the state is entitled to a return on its investment. Training a doctor at a federal university costs the government an estimated 25 million naira, while students pay a fraction of that in fees. “Britain gets a surgeon for free that Nigeria paid for over seven years,” said Prof. Hauwa Ibrahim Danjuma, a health economist at the University of Ilorin. “The question is whether a bond keeps people or just makes them angrier before they go.”

Other countries have tried similar measures with mixed results. South Africa requires a year of community service, which has improved rural staffing but has not stopped emigration. Ghana introduced a bond in the 2000s that was widely evaded.

The hospital in Ilorin has tried its own remedies. It has hired retired surgeons on contract, trained nurse anesthetists, and set up a telemedicine link with Nigerian doctors abroad who review cases in the evenings. On Friday, one of them, in Birmingham, England, guided a junior doctor through a difficult hernia repair by video. The patient, a 54-year-old farmer, was discharged on Sunday.

“That is where we are,” Dr. Adewumi said. “Our best surgeons are on a screen.”