New York Democratic Rep. Alexandria Ocasio-Cortez said Wednesday that immigration was the only way for the U.S. to continue funding Medicare and Social Security programs.

Ocasio-Cortez participated in a Q&A session in the Bronx, New York on Wednesday. During the town hall, she fielded questions about illegal immigration, the opioid crisis and the ongoing Russian invasion of Ukraine.

A man, who described himself as a former firefighter, asked Ocasio-Cortez to explain what she will do to ease the ongoing migrant crisis at the southern border and ongoing drug trafficking's impacts on U.S. communities.

"We have a crisis on our southern border," the man began. "Foreign nationals by the millions pouring in illegally, flooding our country. You are a member of Congress. You write our nation's immigration laws. … What are you going to do with our immigration laws to secure the southern border?"

BIDEN ADMIN ANNOUNCES BORDER OP WITH MEXICO, INCREASED REMOVALS OF VENEZUELANS

Alexandria Ocasio-Cortez

Rep. Alexandria Ocasio-Cortez and other elected officials meet with employees at Elmhurst hospital in New York on June 4, 2021. (Lev Radin/Sipa USA)No Use Germany)

Regarding the devastation caused by opioids entering the U.S. via Mexico, Ocasio-Cortez claimed that port-of-entry security is vital. 

"We have to continue to make investments in making sure that we're scanning and are assessing our ports responsibly," she said.

She went on to claim that the ports through which drugs are entering are often not the same ports asylum seekers are approaching, saying, "When it comes to people, you know, the way that those substances enter are often different points of entry from where people enter."

BORDER OFFICERS IN TEXAS FIND LIQUID METH IN CONDOMS HIDDEN IN PUMPKINS

The congresswoman at one point repeated five times that it is legal to claim asylum at the U.S. border.

"It is legal to claim asylum at the United States border. It is legal. It is legal. It is legal. It is legal to claim asylum," Ocasio-Cortez said.

The representative went on to describe the country's acceptance of immigrants as key to its success when compared to other countries. Comparing the U.S. to Japan and South Korea, where a rapidly aging population and a shrinking workforce poses an existential threat.

CLICK HERE FOR THE FOX NEWS APP

migrants by texas border wall

Venezuelan migrants walk along the U.S. Border fence after crossing the Rio Grande from Mexico to turn themselves in to the U.S. Border Patrol on Sept. 22, 2022 in El Paso, Texas. In recent weeks, Venezuelans have arrived in increasing numbers in El Paso. The city has had to scramble to find housing and other aid for the migrants. (Joe Raedle/Getty Images)

"One of the only reasons that we have been able to have a different fate than that is because we are a country that welcomes immigrants," Ocasio-Cortez told the crowd. "Because we do not have the capacity right now to continue to pay and fund for Medicare and Social Security and continued economic growth and creating more jobs without entrepreneurs. There's no way to make that work."

She continued, "And so when we talk about the question of undocumented people, my priority is by opening legal pathways to citizenship and making sure that we are documented, because this idea of a line and waiting in line, that's not how our immigration system works."