BOSTON — Worcester Polytechnic Institute student Behnam Partopour, one of the international students denied entry into the United States under President Donald J. Trump’s executive order on immigration, was greeted with cheers Friday after he landed at Logan International Airport and made it through customs.

“I feel relieved,” said Mr. Partopour, who was clad in a blue blazer, collared shirt and Chuck Taylors. “My sister, I’m with her now. I can finish my Ph.D. and I can see my friends again. All of this is amazing.”

Mr. Partopour, a 27-year-old chemical engineering Ph.D. student from Iran, said he was sent by WPI to work on a research project in Germany last year and returned to Iran to renew his student visa. While there, he received his F1 student visa but before he could return to the United States, Trump’s executive order barred the entry of refugees and citizens of seven predominantly Muslim countries, including Iran, into the United States.

“We were all very afraid,” said Mr. Partopour. “A lot of times I was hopeless.”

Two federal judges in Boston earlier this week issued a seven-day stay preventing the detention and removal of permanent residents, visa holders, approved refugees, and travelers from the seven barred nations. But on Friday, U.S. District Court Judge Nathaniel M. Gorton ruled that he would not extend the restraining order when it expires Sunday.

Meanwhile, immigration lawyer Heather Yountz said people were still being denied travel by airlines during the week, despite the seven-day stay.

She said a glimmer of hope appeared Thursday when Lufthansa began to allow people from the seven barred countries to fly directly to Logan.

“It was an amazing act by Lufthansa Airlines,” said Ms. Yountz, who has been on the phone advising her clients to fly to Boston on Lufthansa.

“I’m fielding between 50 to 100 phone calls a day, telling them to get on Lufthansa, to fly into Boston, to get in before Sunday before the temporary restraining order is lifted.”

Mr. Partopour was greeted by his sister, Bahar Partopour, and his friends Shirin Hojabri and Ehsan Keyvani. U.S. Rep. James P. McGovern and WPI President Laurie A. Leshin were also on hand to welcome him.

“It was so exciting to watch him walk through those doors and to know that he had made it through,” said Ms. Leshin. “This was the end of quite a long journey.”

Ms. Partopour had strong words about Trump’s immigration order.

“This is horrible,” she said. “It’s taking families apart. It’s against human rights. One of the reasons we are here is because we didn’t have actual human rights in Iran, but now we don’t have it here.”

Mr. McGovern echoed her sentiments. “We’re better than this,” he said.