Supreme Court Justice Antonin Scalia’s traveling companion at the Texas ranch where he died is a longtime Washington lawyer who has represented the Republican Party and shared a love of food, wine and hunting with the late conservative justice.

C. Allen Foster had been the subject of mystery in the days after Scalia’s body was found Feb. 13 inside a ranch bedroom. Authorities said Scalia had traveled to the luxury Cibolo Creek Ranch with a friend but they repeatedly declined to identify him.

A Texas sheriff’s department on Wednesday confirmed that Foster was the man who had flown on a chartered aircraft with Scalia, arriving at a private airport near the ranch the day before Scalia was found dead. A sheriff’s incident report on the investigation described him as a “a close friend of Scalia” and said that he, along with the ranch owner and manager, took Presidio County Sheriff Danny Dominguez to the room where Scalia died.

A representative from Foster’s law firm, Whiteford Taylor Preston, said Foster was traveling and that she would try to reach him.

Foster, a 74-year-old Louisiana native, is a prominent lawyer in Washington. In 1993, he went before the Supreme Court to argue a case on behalf of Hispanic Republicans in Florida who said the state’s reapportionment plan diluted their voting strength. During the argument, Scalia didn’t spare Foster, asking him tough questions he was known for flinging at lawyers from the bench.

“I don’t understand,’’ Scalia said at one point. “I had thought that the whole name of the game in trying to maximize the racial vote is not to keep neighborhoods together, but to keep only so many of them together as will give you 51 percent of the vote.’’

Foster could barely get off a fumbling response amid Scalia’s interruptions.

The court ruled that voting rights had not been diluted. Scalia, along with Justice Clarence Thomas, dissented on procedural grounds.

It is not clear when Scalia and Foster became friends. Legal specialists said the trip Scalia and Foster took to the Texas ranch raised no ethical concerns, calling it common for judges to socialize with lawyers in the close-knit fraternity of elite legal practitioners. Only if Foster had a pending case before the Supreme Court, they said, would there have been an issue.

“You can’t say ‘I’m not going on a trip with my friend because he may someday be a party in a case before the Supreme Court,’ ’’ said Stephen Gillers, an expert on legal and judicial ethics at New York University law school. Told that Foster’s sole argument before the court had been in 1993, Gillers said: “Twenty years ago? It’s not even close. Lawyers wouldn’t blink at that.’’

Despite having a famous friend, Foster has mostly stayed out of the news. Over the years, his eclectic group of clients has included the Republican Party, the libertarian Cato Institute, plaintiffs enslaved by Japanese corporations during World War II, and the former Blackwater Security Consulting, which was involved in a series of questionable incidents, including a 2007 shootout in Iraq that killed 17 Iraqis.

Amy Brittain, Alice Crites and Sari Horwitz contributed to this story.