SEATTLE — The U.S. Border Patrol has quietly stopped its controversial practice of routinely searching buses, trains and airports for illegal immigrants at transportation hubs along the northern border and in the nation’s interior, preventing agents from using what had long been an effective tool for tracking down people here illegally, The Associated Press has learned.

Current and former Border Patrol agents said field offices around the country began receiving the order last month — soon after the Obama administration announced that to ease an overburdened immigration system, it would let many undocumented people stay in the country while it focuses on deporting those who have committed crimes.

The routine bus, train and airport checks typically involved agents milling about and questioning people who appear suspicious, and had long been criticized by rights groups. Critics said the tactic amounted to racial profiling and violated the civil liberties of travelers.

But agents said it was an effective way to catch unlawful immigrants, including smugglers and possible terrorists, who had evaded detection at the border, as well as people who had overstayed their visas. Often, those who evade detection head quickly for the nearest mass public transit in hopes of reaching other parts of the country.

Halting the practice has baffled agents, especially in stations along the northern border — from Bellingham, Wash., to Houlton, Maine — where the “transportation checks” have been the bulk of their everyday duties. The Border Patrol is authorized to check vehicles within 100 miles of the border.

The order has not been made public, but two agents described it to the AP on condition of anonymity because the government does not authorize them to address the media. The union that represents Border Patrol agents planned to issue a news release about the change Monday.

“Orders have been sent out from Border Patrol headquarters in Washington, D.C., to Border Patrol sectors nationwide that checks of transportation hubs and systems located away from the southwest border of the United States will only be conducted if there is intelligence indicating a threat,” the release says.

Those who have received the orders said, agents may still go to train and bus stations and airports if they have specific “actionable intelligence” that an illegal immigrant is there who recently entered the country.

An agent in Washington state said it’s not clear how agents are supposed to glean such intelligence, and even if they did, under the new directive they still require clearance from Washington, D.C., headquarters.

U.S. Customs and Border Protection spokesman Bill Brooks, repeatedly insisted that any shift in enforcement tactics does not amount to a change in policy as local commanders still have authority to aggressively pursue illegal immigrants near the border and at transportation hubs.

“It’s up to the local commander to position his agents the way he wants to position them. What we’ve done is gone to a risk-based posture,” he said.

Shawn Moran, vice president of the agents’ union, was outraged at the changes.

“Border Patrol managers are increasing the layers of bureaucracy and making it as difficult as possible for Border Patrol agents to conduct their core duties,” the National Border Patrol Council’s statement said. “The only risks being managed by this move are too many apprehensions, negative media attention and complaints generated by immigrant rights groups.”

The Border Patrol has dramatically beefed up its staffing in the decade since Sept. 11, 2001, doubling to more than 20,000 agents nationally. Along the northern border, the number has jumped from about 300 in the late 1990s to more than 2,200.

Until receiving the new directive, the Bellingham office, about 25 miles from the Canadian border, kept agents at the bus-and-train station and at the local airport 24 hours a day, seven days a week. Now, the agents have little work to do, according to a Washington state-based Border Patrol agent who has been with the agency for more than 20 years.

The situation is similar in upstate New York, where an agent said that a senior manager relayed the new directive during a morning roll call last month.

Since then, instead of checking buses or trains, agents have spent shifts sitting in their vehicles gazing out at Lake Erie and Lake Ontario, where few illegal immigrants cross.

Doug Honig, spokesman for the American Civil Liberties Union of Washington state, welcomed the news.

“If the Border Patrol is indeed not boarding buses and trains and engaging in the random questioning of people, that’s a step in the right direction,” he said. “People shouldn’t be questioned by government officials when there’s no reason to believe they’ve done anything wrong.”