Video taken by a Montana woman as she and her friend were questioned and detained by a U.S. Border Patrol agent after he overheard them speaking Spanish at a gas station has caught the attention of border patrol officials and civil liberties groups.

Ana Suda and Mimi Hernandez — both U.S. citizens — were chatting in Spanish as they went to buy eggs and milk around midnight Wednesday in Havre, a small town about 35 miles from the Canadian border. Suda said that's when a border patrol agent overheard them.

"He asked us where we were born, so I looked at him and I said, 'Are you serious?'" Suda told NBC News on Monday. "He said, 'I'm very serious.'"

The agent then asked Suda and Hernandez for their identification, she added.

A Border Patrol agent detained and questioned two US citizens when he overheard them speaking Spanish at a gas station in Montana. Viral Hog

They went outside to the parking lot, and Suda began to record on her cellphone.

In the video, Suda asked the agent why he was asking for their IDs.

"Ma'am, the reason I asked you for your ID is because I came in here, and I saw that you guys are speaking Spanish, which is very unheard of up here," the agent, who identified himself as Agent O'Neill, said in the video.

When Suda, 37, asked if she and her friend were being racially profiled, the agent responded no.

"It has nothing to do with that," he said. "It's the fact that it has to do with you guys speaking Spanish in the store, in a state where it's predominantly English-speaking."

Suda said she began recording because she was uncomfortable and afraid.

"I picked up my phone and started recording him because I wasn't doing anything wrong," she said, adding, "That is the only way you can defend yourself."

She said the agent took their IDs and kept them in the parking lot for about 35 to 40 minutes.

"He didn't say anything when he gave me back the documentation. He said something like 'Thank you, you are free to go,'" Suda said.

The incident in Montana is the latest encounter over speaking Spanish to go viral after a New York City lawyer's racist rant at a lunch spot last Tuesday showed him threatening to call immigration agents on workers.

Suda said she still believes she and Hernandez were being racially profiled. Both are Mexican-American and speak fluent Spanish. She said she was born in El Paso, Texas, and raised across the border in Mexico, but has spent the last 14 years in the U.S. with her husband and 7-year-old daughter.

Hernandez was born in central California, she said.

"I don't have another option to think something else because we were just speaking Spanish," she said.

"I was buying eggs," she added. "I don't think that's suspicious."

A U.S. Customs and Border Protection spokesperson said in a statement that the incident was being reviewed to make sure appropriate policies were followed. Agents have broader authority when operating within 100 miles of a U.S. border, such as putting up checkpoints and questioning people in their vehicles about their citizenship — but CBP policy also says agents cannot stop or detain someone solely on their race or ethnicity.

Agents and officers "are committed to treating everyone with professionalism, dignity and respect while enforcing the laws of the United States," the spokesperson said. "Although most Border Patrol work is conducted in the immediate border area, agents have broad law enforcement authorities and are not limited to a specific geography within the United States."

Agents have the "authority to question individuals, make arrests, and take and consider evidence," the spokesperson added. "Decisions to question individuals are based on a variety of factors for which Border Patrol agents are well-trained."

"I was buying eggs. I don't think that's suspicious."

The incident was reminiscent of a widely circulated video in January that showed Border Patrol detaining a woman on a Greyhound bus in Fort Lauderdale, Florida, and asking riders for proof of citizenship during a security checkpoint. Under federal law, Border Patrol agents may search any vessel, aircraft or vehicle within 100 miles of any border for immigrants in the country illegally.

Suda said that in Havre, a town of about 10,000, members of the community know each other and she was embarrassed by the encounter.

"Here they know you," she said. "When you see somebody stopped by police, what do you think?"

Suda said she is reaching out to the American Civil Liberties Union to see if they can take any action after the incident. She said she was reaching out to the group because of a conversation she had with her daughter.

"She saw the video, she came to me and she asked me, 'Does that mean we can't speak Spanish anymore?' That's very sad," Suda said.

"I told her, 'No, you are very smart, you speak two languages. You need to be proud to speak Spanish,'"she said. "I want her to know she can speak Spanish in whatever place she wants and nothing happens and no one is going to stop her just because she speaks Spanish."

The ACLU did not immediately respond to a request for comment, but said in a tweet: "Speaking Spanish is not a valid reason for Border Patrol to question or detain you.”