President Donald Trump signed an executive order halting refugee admissions and immigration from certain Arab countries on Friday, but federal officials told NBC News that immigration officers may have been stopping and even banning valid visa holders from returning to the country weeks before the official directive.

Two federal officials familiar with the situationconfirmed to NBC News that as many as 40 individuals with F1 student visas, many who left the country for winter break, were told their visas were revoked when they returned stateside to resume classes.

One of the individuals left the country on Jan. 3 and his visa was revoked on Jan. 4, one immigration official confirmed. An official stated that this is highly unusual since the individual had already been put through extensive security vetting prior to his departure.

Related: Trump Travel Restrictions Leave Refugees Stranded: Reports

It's unclear whether the visa issues were directly related to the president's recent executive order, and the circumstances around each case are different. Nonetheless, some are advising caution to international students — particularly those from Iran, Iraq, Syria, Libya, Yemen, Sudan, and Somalia, the seven countries enumerated by Trump as needing “extreme vetting.”

“My advice to anyone holding a visa from any of these countries is do not go home because you will not get back in,” the official said.

However, the students who ran into visa problems are not from the countries listed in Trump's executive order. Instead, they hold passports from places like Saudi Arabia, Jordan, and Turkey, the official added.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Hazami Barmada, a social justice activist and Harvard graduate student who is currently working with four individuals whose F1 student visas were rejected after they returned to American soil, said the students are terrified and scared of coming forward.

“There is definitely a pattern,” she said. “Totally unrelated people are saying the same thing happened to them, even down to what they were told by immigration officers.”

They are graduate students, some of whom attend Ivy League universities and are well-credentialed, she added. An immigration official confirmed to NBC that at least two students attended Ivy League universities, one on a full scholarship.

Related: Trump Signs Order Suspending Admission of Syrian Refugees

Princeton University preemptively issued a notice cautioning its faculty and student body on Friday. “We have strongly advised students and scholars who might be affected and who have travel plans in the coming days to defer travel outside of the United States until there is some clarity and legal analysis of the situation or, if they must travel, to seek legal counsel before they do.”

Those with student visas who are in the country are now facing two very difficult scenarios: One where they cannot leave to go home to see loved ones and the other losing their education if they do.

M. A. Majid, an international college student on an F1 visa at the University of Illinois, said he was planning on going back to Jordan to attend his brother’s wedding in the summer. His plans have now changed.

“If I want to complete my education, what I spent so much time and money on achieving, I may have to do it at the cost of not seeing my family now,” he said. “I don’t have a choice anymore.”

Another high-ranking federal official verified to NBC News that there was an abnormal increase in complaints by Middle Eastern students who said they were blindsided with visa revocations after arriving in the United States in the week before Trump order.

It’s possible that immigration officials saw the tide turning and preemptively applied polices they were anticipating, the official said.

Individuals stopped at immigration were told they have the option of returning to their country voluntarily or face criminal penalties for violating U.S. law, said another federal official. No other explanation was given as it is not legally required, the official said.

“To slap an expedited removal without any question and answer is odd,” said Leslie Holman, an immigration attorney and former president of the American Immigration Lawyers Association. “It seems improper.”

In addition to the visa revocation and expedited removal, several individuals were hit with a five-year ban, barring them from re-entering the country, including those who left voluntarily, the official confirmed. People leave voluntarily in order to avoid a ban, but it was put on them anyway, the official said.

“Essentially all valid visas are irrelevant now,” the official said. “And they have been before the order.”

The Department of Homeland Security did not immediately return a request for comment. A State Department spokesperson said the department was prohibited from commenting on individual visa cases.

The American Association of Immigration Lawyers also advised caution. In a statement released one day before Trump’s executive order, the group said to “consider advising clients who might be affected by the Executive Order to refrain from traveling outside of the United States if they are already here, or try to return to the United States as soon as possible if they are outside of the country.”

Since Trump’s order does not define what it means to be “from a country,” the order should be read to include “passport holders, citizens, nationals, dual nationals, etc.” “in an abundance of caution,” the statement added.