Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Gilmer Barrios only grabbed a sweater, his cellphone, an expired ID, mask and gloves and went to the border Thursday after spending 21 days in Tijuana, Mexico. U.S. officials who had deported him under irregular circumstances were waiting for him on the other side.

"I've been told that the immigration agents have been waiting for me since 3:30 p.m. at the guard post," he said over the phone, before getting in a car to meet with them.

Carlos Rafael Oliva Calderón, the Guatemalan consul in Tijuana, was going to accompany him to the border.

In a matter of hours, Barrios went from having "no new information and locked away for fear of the virus" in Tijuana to being able to return to the country where he left behind an American wife and two children on a Monday after he went out to work trimming trees.

Barrios, 28, was arrested March 23 by immigration authorities in southern California and was deported four days later. After Telemundo News reported on Barrios' deportation under irregular circumstances, Oliva Calderón sought out his counterpart in Los Angeles, contacted the federal government and warned Mexican immigration authorities.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Equipped with gloves and masks, Barrios reached San Ysidro, the largest immigration checkpoint between Tijuana and San Diego, Thursday afternoon, according to the Guatemalan consulate in Tijuana.

Border Protection agents with new powers

U.S. Customs and Border Protection (CBP) has been given the authority to bypass immigration laws and immediately deport migrants who cross the border, part of emergency measures during the coronavirus pandemic. But Barrios' case suggests that border agents used the emergency powers to deport an immigrant who had been living in the U.S. and who had a case that was open in American courts.

Barrios said he doesn't recall any contact with agents from Immigration and Customs Enforcement — who are responsible for carrying out deportations. He also doesn't recall seeing an immigration judge, who is responsible for issuing orders to return to one's country of origin. In addition, Barrios is from Guatemala but he was taken to Mexico — where he doesn't have permission to live.

After multiple requests for comment, CBP told Telemundo News it is still looking into the Barrios case.

José Barillas Trennert, the Guatemalan consul general in Los Angeles who negotiated Barrios' reentry to the U.S., told Noticias Telemundo: “This person was expelled without due process. We asked Border Patrol authorities for an explanation and they told us that, if we located the family, they could accept him back to continue with his immigration process in the United States."

Barrios was transferred to a Border Patrol station in Chula Vista, California, after being readmitted into the U.S., according to his legal representative and relatives.

"I feel very relieved that he is already on this side, in the United States; it was scary in Tijuana," his wife, Kimberly, said.

Emilio Amaya, Barrios' legal representative, hopes to have him released on bail soon. He said his client doesn't have a deportation order. He does, however, have a pending case in immigration court to remain in the country legally, in part thanks to his wife, who is a U.S. citizen.

Investigative reporter Damià Bonmatí first reported the story for Noticias Telemundo.

Follow NBC Latino on Facebook, Twitter and Instagram.