Illegal immigration across the Southwest border has surged back to Obama-era levels, according to the latest data released last week that suggests the gains President Trump made early in his tenure have worn off.

Nearly 40,000 illegal immigrants were nabbed attempting to jump the border in November, which was up about 12 percent compared to October, and more than twice the monthly numbers from March and April, when Mr. Trump touted his early accomplishments.

Perhaps just as worrisome for officials is the rise in families traveling together, which surged 45 percent last month, and unaccompanied minors traveling without parents, which rose 26 percent in November, according to the numbers released Friday.

QUIZ: US Citizenship Test (Part II) -- could you pass?

Homeland Security said those numbers are still an improvement over the worst years of President Obama.

“Under President Trump, illegal immigration has declined dramatically over the last year,” said spokesman Tyler Q. Houston.

But he said more needs to be done, and said action needs to come from Capitol Hill.

PHOTOS: 21 best guns for home protection

“The administration is working tirelessly to secure the border, enhance interior enforcement and establish a merit-based immigration system. But we need Congress to act immediately to close immigration loopholes, fund the border wall, terminate outdated visa programs and provide the necessary tools for DHS officials to carry out their mission,” Mr. Houston said.

The 39,006 people caught in November included 29,086 caught by the Border Patrol, and 9,920 who tried to come through official ports of entry without permission. The total is still less than 2015 or 2016, but is more than 2012, 2013 or 2014, signaling a return to Obama-era levels of illegal immigration on the border.

Just last week, the Trump administration crowed over its gains, pointing to a nearly 30 percent decline in people being caught at the border compared to the previous year. But they did say they were “very concerned” by the latest trends, which have been borne out in Friday’s numbers.

CBP officials said cartels have figured out how to “exploit legal and policy loopholes” in the U.S. to get illegal immigrants into the country and give them a chance to blend into the shadows.

In addition to more migrants, border agents and officers are catching more opioids, heroin and cocaine being smuggled from Mexico to the U.S.

Amount of people caught and drugs seized at the border is considered a rough approximation for the overall flow, so an increase in apprehensions is believed to indicate an increase in the overall flow of illegal migrants.

Border Patrol agents say the numbers dropped when Mr. Trump first took over because of his get-tough stance, with word filtering back to Mexico and Central America — the biggest sources of southwest border jumpers — that the U.S. was stiffening its enforcement.

But in fact deportations dropped over the last year and despite some high-profile enforcement actions newcomers are still able to exploit U.S. policy so that even if they face deportation, they are often released and have a chance to disappear into the shadows.

New Homeland Security Secretary Kirstjen Nielsen, traveling to the border last week, said she’s aware of the surge on the border, and ticked off a long list of changes the Trump administration is seeking to get a handle on it.

She said more manpower and infrastructure — including more fencing — is needed, but also said the government needs to do more to quickly deport illegal immigrants who arrive at the border. She said the average immigration court deportation case lasts 600 days, meaning that even if someone does get to the U.S. they have time to blend into the shadows.

Ms. Nielsen vowed changes.

“We are going to make it very, very difficult to remain here unlawfully,” she said.