(CNN) A Guatemalan woman and her 8-year-old son were rescued in Texas after thousands of bees attacked them near the border, US Customs and Border Protection officials said.

A Border Patrol agent patrolling in Brownsville, Texas, on Tuesday noticed a small swarm of bees in his vehicle. After clearing his vehicle, the agent started tracking the rest of the bees and spotted thousands of them covering what it looked like "jacket and a bundle," the agency said in a statement.

"Upon closer investigation, the agent realized the bundle was a person curled up in the fetal position," the statement said.

The agent yelled at the person to get up and run to his patrol vehicle but realized that someone else needed help.

"As the person stood up, the agent noticed the person was covering a small child," the statement said.

Read More