Hadiza Aliyu lives in Borno, the Nigerian state at the epicenter of the Boko Haram crisis that has left tens of thousands dead. But she thought she had found a way out.

Ms. Aliyu was preparing to apply to move to the United States, where she once studied and where her two brothers live.

She was furious when she heard about the extended ban.

“Trump has been looking for a way to get at us Africans for a very long time, and finally got us,” Ms. Aliyu said. “To hell with Republicans and their supremacist ideas.”

Mika Moses moved to Minnesota from Nigeria nine years ago to join his mother and siblings, who were allowed entry after the family was attacked in religious riots in their northern city of Kaduna in 1991. His wife, Juliet, and their daughter were planning to join him, but are stuck in Kaduna, where Ms. Moses sells soda in a small store.

She said they were heartbroken by the news that the move would now be impossible.

“I have been struggling to raise our daughter alone,” she said. “Why would Trump do this to us, after we have waited for nine years?”

Nigerians already living in the United States have been calling lawyers to try to figure out whether they will have to leave. Marilyn Eshikena, a biomedical research ethicist, has lived in the United States for the past seven years, but her visa expires this year. Her employer sponsored her application for a green card.

“If it turns out that everything needs to stop, they will feel cheated, because they spent a lot of money on this process,” Ms. Eshikena said. “I will also feel cheated, because all the time that I spent working here will ultimately be for nothing. I can’t even imagine what packing up and leaving will mean for me.”