Jose Antonio Vargas, the Pulitzer Prize-winning journalist who is perhaps the best-known undocumented immigrant in the United States, was detained by federal agents for much of the day Tuesday after trying to leave a Texas border town without a valid U.S. visa.

Vargas was taken into custody Tuesday morning by U.S. Customs and Border Protection agents at McAllen-Miller International Airport and held for about eight hours “after he stated that he was in the country illegally,” according to a Department of Homeland Security statement. He was given a notice to appear before an immigration judge.

“As an unaccompanied child migrant myself, I came to McAllen, Texas, to shed a light on children who parts of America and masny in the news media are actively turning their backs on,” Vargas said in a statement. “But what I saw was the generosity of the American people, documented and undocumented, in the Rio Grande Valley.”

Vargas, 33, has spent the past few years crusading on behalf of fellow undocumented immigrants. He went to south Texas amid a burgeoning crisis along the border prompted by a influx of minors from Central America.

“I want to thank everyone who stands by me and the undocumented immigrants of south Texas and across the country,” he added. “Our daily lives are filled with fear in simple acts such as getting on an airplane to go home to our family.”

In airports located in a “buffer zone” along the border, Transportation Security Administration officials are joined at security checkpoints by Border Patrol agents. TSA agents check identification, but Border Patrol agents check passengers with foreign passports for appropriate visas, green cards and other documents that allow them to be in the United States.

Vargas tweeted shortly before his detention that he was about to go through security at the airport in McAllen, headed to Los Angeles via Houston, with nothing more than a Philippine passport and a pocket-size U.S. Constitution. “I don’t know what’s going to happen,” he wrote.

In a text message sent over the weekend to Post reporter Ernesto Londoño, Vargas wrote: “I feel stupid. I’ve been traveling around the country, visiting 43 states in like 3 years, and I’ve been flying using my Philippine passport. But I’ve never been to the Texas border area. I just figured I could use the passport. But apparently I can’t because border patrol agents check foreign passports.”

However, in the DHS statement, officials indicated that Vargas’s immigration status was not high on their priority list.

“Mr. Vargas has not previously been arrested by [Immigration and Customs Enforcement], nor has the agency ever issued a detainer on him or encountered him,” the statement said. “ICE is focused on smart, effective immigration enforcement that prioritizes the agency’s resources to promote border security and to identify and remove criminal individuals who pose a threat to public safety and national security.”

White House spokesman Shawn Turner declined to discuss the detention, saying: “This is a law enforcement issue involving a specific case, so it would not be appropriate for the White House to comment.” Asked about Vargas at a White House briefing, press secretary Josh Earnest said he had “no reaction to his detention.”

Vargas, who came to the United States as an unaccompanied minor from the Philippines when he was 12 years old, revealed his undocumented status in a 2011 essay published by the New York Times. That same year, he made headlines again when he was kicked out of a Mitt Romney campaign event in Iowa, where he had been holding up a sign that said: “I AM AN AMERICAN W/O PAPERS.”

In 2012, he appeared on the cover of Time magazine. Vargas also launched Define American, a nonprofit U.S. immigration-reform campaign, and testified last year at a Senate hearing on immigration reform.

Vargas also wrote and directed “Documented,” a film about his status as an immigrant without papers. In the documentary, Vargas says he dreams of getting a green card and flying back to the Philippines to see his mother for the first time since he was a child.

Vargas was a Washington Post reporter from 2004 to 2009 and was part of the team of journalists that won a Pulitzer Prize for coverage of the Virginia Tech shootings.

Juliet Eilperin, Katie Zezima and Josh Hicks contributed to this report.