A French Holocaust historian scheduled to talk about "writing in dark times" at a Texas A&M University symposium says he was nearly deported after he arrived in Houston last week.

Henry Rousso, an Egyptian-born academic who had flown from Paris, posted on Twitter that he was detained for 10 hours at the George Bush Intercontinental Airport in Houston and was "about to be deported."

Immigration attorneys and officials with Texas A&M secured his release Thursday.

I confirm. I have been detained 10 hours at Houston Itl Airport about to be deported. The officer who arrested me was "inexperienced" https://t.co/SdIKWKQbnr — Henry Rousso (@Henry_Rousso) February 26, 2017

Richard Golsan, director of the Melbern G. Glasscock Center for Humanities Research at the university, said Rousso had been "mistakenly detained."

"When he called me with this news two nights ago, he was waiting for customs officials to send him back to Paris as an illegal alien on the first flight out," Golsan said Friday during the symposium session that Rousso was supposed to attend, according to The Eagle of Bryan-College Station.

A spokeswoman for Customs and Border Protection in Houston wasn't available to comment.

The problem appears to have involved a $2,000 honorarium Texas A&M was paying Rousso for his participation in the symposium, the scholar told The New York Times.

"With a tourist visa, I'm not allowed to work," Rousso told the Times. "This is true — except for scholars."

While visitors with tourist visas are banned from taking employment in the U.S., the rules allow them to accept an honorarium for academic activities — such as lectures — for up to nine days.

A Fort Worth immigration attorney told the Times he got a call from the dean of the Texas A&M law school Wednesday night.

"They were in a bit of a panic," said the lawyer, Jason Mills.

Rousso described for the Huffington Post how an immigration officer denied him admission. The scholar wrote that he was escorted to an office for an interrogation that he was told was "a random check."

Rousso said the immigration officer who interviewed him was suspicious of his honorarium and concluded he was coming back to the U.S. to work illegally after noticing an expired exchange visitor visa on his passport for a stint at Columbia University that ended in January.

The immigration officer repeatedly asked questions about Rousso's work, his home and his family, the scholar wrote.

Rousso, director of research at the French National Center for Scientific Research, has studied the Vichy government in France that collaborated with Nazi Germany during World War II. Born in Cairo in 1954, Rousso and his family were forced out of Egypt two years later under anti-Semitic measures, according to the Jewish Telegraphic Agency.

Egypt is not one of the seven Muslim-majority nations targeted in President Donald Trump's executive order temporarily banning entry to certain visitors to the U.S. That order has been challenged in federal court.

The immigration officer told Rousso he'd put him on the next plane back to Paris, according to the scholar's account. He wrote that he mostly sat during his 10-hour detention, without his phone but with access to food and drink.

"Two police officers arrived and headed for the gentleman seated in front of me, maybe a Mexican," Rousso wrote. "They were coming to take him to the boarding gate. Then they handcuffed him, chained him at the waist, and shackled him. I couldn't believe it and I wondered if I would have to endure the same fate."

Rousso wrote that he was released at 1:30 a.m. Thursday by a "policeman" who explained that the officer who had reviewed his case was inexperienced.

"That is the situation today in this country," Rousso wrote. "We must now face arbitrariness and incompetence at all levels."

Thank you so much for your reactions. My situation was nothing compared to some of the people I saw who couldn't be defended as I was. — Henry Rousso (@Henry_Rousso) February 26, 2017

Warm thanks Michael K. Young, pdt Texas A&M, profs. Fatma Marouf & Joe Golsan, Sujiro Seam, Consul of France, and all those who helped me — Henry Rousso (@Henry_Rousso) February 27, 2017

Rousso gave his lecture Friday as planned. Texas A&M previewed his presentation with this blurb: "More than ever, historians have to rethink their standards and the ways that they are writing history. In an era where opinions, 'post-truth,' and so-called democratization of knowledge are predominant, they should foster a reliable conception of how to write about recent issues."

Rousso told the Houston Chronicle he'll be reluctant to come back to the U.S., "even if I love this country."

The Daily Stormer, a neo-Nazi website that supported Trump's bid for the presidency, celebrated the incident in a post: "This is so absolutely wonderful. Everything is happening exactly as we planned it."

Trump condemned anti-Semitism last week in reaction to a string of bomb threats against Jewish community centers and the desecration of a Jewish cemetery in St. Louis. His statement failed to pacify some critics who chided him for not speaking out earlier.

"The anti-Semitic threats targeting our Jewish community and community centers are horrible and are painful and a very sad reminder of the work that still must be done to root out hate and prejudice and evil," Trump said during a visit to the National Museum of African American History and Culture.