An agency spokesman declined to discuss the specific episode but said that the officer’s actions were under review.

“U.S. Customs and Border Protection agents and officers are committed to treating everyone with professionalism, dignity and respect while enforcing the laws of the United States,” a spokesman at Customs and Border Protection said in an email on Monday. “Decisions to question individuals are based on a variety of factors for which Border Patrol agents are well-trained.”

President Trump has maintained a longstanding desire to greatly increase enforcement on the borders and deliver on a campaign promise to crack down on immigration. The president’s anger over immigration and the absence of a wall on the southern border with Mexico has spilled out in public this month. He berated the Department of Homeland Security for not doing enough to secure the borders and called some immigrants “animals” during a White House meeting.

The Trump administration’s rhetoric and tough actions on immigration have stoked fear in some communities about it contributing to a rise in discrimination. The day before Ms. Suda’s encounter in Montana, a lawyer in Manhattan was recorded spewing a racist rant in a restaurant because he objected to employees speaking Spanish.

There are more than 19,000 Border Patrol agents in the United States, and nearly all of them roam the rugged, wide-open terrain near the Mexico border, stretching from South Texas to Southern California. But a few thousand agents patrol the country’s northern boundary with Canada, including 183 officers stationed in Havre, a remote agricultural city of 9,000 people about 35 miles south of the border.

The encounter at the Town Pump in Havre highlights the far-reaching power of Border Agents, whose authority goes beyond the immediate border and checkpoints. Their domain extends 100 miles inland from the outline of the United States, a vast area that includes up to 66 percent of the country’s population.

But their reach is limited in one way: They cannot stop people solely because of their race or ethnicity. Jonathan H. Feinberg, a civil rights lawyer in Philadelphia, said that courts have found that a person’s language is prohibited in the same way.