It was pitch black when the Border Patrol rolled up to Raymond Mattia’s home on a remote corner of the Tohono O’odham reservation in southern Arizona, investigating a report of gunshots.

Border agents, smugglers and migrants were a familiar sight in the tiny desert village a mile from the southern border where the Mattia family had lived for decades. Mr. Mattia often patrolled his property with a flashlight, his family said. That night in May, Mr. Mattia told an older sister over the phone that he was heading outside to meet the agents, she said.

But in a chaotic instant in May, three Border Patrol agents fatally shot Mr. Mattia as they came upon him in the desert, hitting him nine times, according to an autopsy. A Border Patrol report says he had tossed a sheathed machete toward an officer and then “abruptly extended his right arm.” His family said he was unarmed and posed no threat.

His death has touched off an outcry on the Tohono O’odham (pronounced Toh-HO-noh AW-tham) Nation, which lies along 62 miles of the southern border, and stirred up long-running resentments over the federal agency’s presence on the Native American territory.

Tribal members pass through border-security checkpoints stationed just outside the reservation on their way to Tucson, the nearest big city, and say they are regularly pulled over and questioned — encounters that have left a film of fear and distrust.

“I’m always on guard, always scared, nervous,” said Vivian Manuel, who lives near Mr. Mattia’s village. “They’ll harass you: What are you doing out here? Are you a tribal member?”

Yet Tohono O’odham leaders have called the Border Patrol an ally in confronting drug and human smuggling on a 13,000-person reservation the size of Connecticut. More than 600 migrants have died there over the past decade trying to cross the deserts and ragged mountains, according to the migrant-aid group Humane Borders. The tribe says trafficking has damaged its land and cost the tribe millions in extra work for its roughly 60-member police force.

John R. Modlin, the Border Patrol’s Tucson sector chief patrol agent who oversees the area, has described tribal partnerships as “essential to our national security mission.” The Border Patrol’s social-media feed is filled with posts showing agents helping the tribe fight wildfires, planting saguaro cactuses and stopping traffickers who cross the reservation with migrants packed into car trunks.

The Border Patrol released a lengthy account of Mr. Mattia’s killing as well as body-camera footage. An investigation is being conducted by the F.B.I. and the Tohono O’odham Police Department. The agencies declined to discuss the shooting, citing the investigation.

Ned Norris Jr., the Tohono O’odham chairman, said in a statement that he had “serious concerns” about Mr. Mattia’s killing but was reserving judgment. He did not respond to a request for comment.

News of the shooting has rippled through other tribes near the border, forcing some leaders to grapple with their own mixed feelings about the federal presence around their lands.

“We always worry about both sides, whether it’s the cartels or some of the agents who man these border patrols who have guns,” said Peter Yucupicio, chairman of the Pascua Yaqui Tribe, whose headquarters are in Tucson. “You start wondering as a tribal member: If I do something wrong, am I going to get all shot up.”

United States Customs and Border Protection, the umbrella agency of the Border Patrol, has reported an average of roughly 15 use-of-force incidents involving guns each year since 2020. Many of those occurred after vehicle pursuits or other attempts to apprehend smugglers and migrants, according to news reports and accounts from the agency.

But the shooting of a tribal member on tribal lands sets this case apart.

The Tohono O’odham, whose name means “desert people,” ranged across the Sonoran desert for centuries before there was a border, following seasonal water flows, hunting deer and harvesting fruit from cactuses, according to tribal histories.

Their traditional lands were split in two when the 1853 Gadsden Purchase set the boundary between the United States and Mexico.

In the decades that followed, the Border Patrol has built surveillance towers and substations on the reservation, and its white pickups roam highways and sandy back roads. The tribe has about 33,000 members, most of whom live off the reservation.

Many try to honor their cross-border heritage by visiting family and graveyards on the Mexican side, or by crossing to hold religious ceremonies or tend to ranching stock.

They must present tribal identification cards to pass into the United States at dedicated gates, and tribal leaders say that Tohono O’odham trying to travel back and forth have been detained and had ceremonial items like pine leaves and sweet grass confiscated.

The tribe resisted the Trump administration’s campaign to build a border wall as an infringement on its freedoms, so instead of a 30-foot-high line of steel columns, the border is marked mostly by X-shaped vehicle barriers and a gap-toothed bollard fence.

Some in the tribe said they were not bothered by the Border Patrol’s presence.

But others said a history of run-ins had left them leery, such as a 2014 incident in which a Border Patrol agent shot and wounded two joyriding Tohono O’odham men after they accidentally clipped the agent’s parked pickup truck one moonless night. A federal judge later found the shooting was not justified and awarded the men more than $250,000.

“They need to look at us as people and not like we’re all criminals,” said Angelita Reino Ramon, whose 18-year-old son was fatally struck by a Border Patrol truck 20 years ago in what a judge later called an unavoidable accident. “They need to have more respect.”

The exact circumstances that led to Mr. Mattia’s death the night of May 18 are still hazy.

The call began around 9 p.m. when tribal police asked the Border Patrol for help responding to a report of two gunshots heard in Mr. Mattia’s village, Menagers Dam, according to a statement from Customs and Border Protection.

In radio recordings and body-camera videos, dispatchers and officers said it was unclear where the shots had come from. Before heading out, they cautioned that someone in the area might have a rifle.

At 9:37 p.m., the agents and at least one tribal police officer pulled up to the village and spread out around Mr. Mattia’s dark cinder-block house. There was just a sliver of moon that night, and in the video, their flashlights barely penetrate a ghostly landscape of outdoor furniture, creosote bushes and cactuses.

“I thought somebody just ran this way,” an agent said, jogging into the brush.

The tribal officer and agents found Mr. Mattia near a wooden structure about 100 yards away from his house. They ordered him to come out with his hands up. “I am,” he said and tossed a sheathed machete through the air, which landed near an officer’s feet.

Several officers started yelling, ordering Mr. Mattia to take his hands out of his pocket and get on the ground. Seconds later, they fired the fatal burst of shots.

As the agents handcuffed and flipped Mr. Mattia onto his back, one yelled out to “secure the gun” that they said was beneath his limp body. Instead, they found a cellphone and its case.

The case is already testing parallel efforts by the Biden administration both to strengthen ties and trust with tribes, and overhaul how Border Patrol shootings are investigated.

Last year, the administration disbanded secretive “critical incident teams” within the Border Patrol that had been criticized for effectively allowing the organization to investigate itself after events like Mr. Mattia’s killing. The administration also ordered federal law-enforcement agencies, including the Border Patrol, to wear body cameras and promptly release footage after shootings.

The administration’s Covid rescue package contained $1.75 billion for American Indians and Alaska Natives, and the administration also created a Homeland Security advisory council focused on tribal issues. Its 15 members include the Tohono O’odham tribal chairman.

Mr. Mattia’s relatives say they have little faith in the investigations, and have struggled to get answers from both the tribal government and the Border Patrol.

Frustrated, a dozen relatives and supporters put on matching red T-shirts bearing Mr. Mattia’s photo and held a small protest across the highway from a Border Patrol station, just outside the reservation boundaries.

They burned sprigs of creosote bushes and took turns waving posters that called for justice and huddling under umbrellas to get out of the sun.

Mr. Mattia’s family described him as a ceremonial leader in their community who made wood carvings and loved hunting deer. His sister, Annette Mattia, said the family had lived in the same area for generations, but that the shooting had shattered their sense of home.

“We don’t even want to be here anymore,” she said.