A Metro Transit police officer fatally shot a man inside a rail tunnel Thursday night after the man — pants-less and shoe-less — rushed at her holding a large tree branch, according to two officials familiar with the investigation.

Police said they do not know why the man, who was inches from the officer when she opened fire, was walking through the dimly lit tunnel between the ­Stadium-Armory and Potomac Avenue stations in Southeast Washington.

Authorities identified him as Bobby Gross, 35, who has lived in Virginia and the District, and who has arrests for crimes that include drug offenses, assault and larceny.

The operator of a Franconia-Springfield-bound Blue line train spotted him and called Metro’s operations center about 8:53 p.m. By 9:10 p.m., police said, Gross had confronted the veteran officer, who was alone. Police said she shot several times, striking him at least once. He collapsed on the westbound tracks 400 feet east of the Potomac Avenue platform, where he was pronounced dead.

It was the first fatal shooting by a Metro transit officer since 2012 — when a man was killed during a shootout in Lanham — and it remains under investigation by D.C. police, who handle all death cases in the District. Their results will be forwarded to the U.S. attorney’s office, as is routine, to determine whether the shooting was legally justified. The officer who fired is on paid administrative leave.

D.C. police and Metro released some details of the investigation Friday but declined to discuss many other issues. They would not identify the officer, describing her only as a more than 10-year veteran of the force, and both agencies omitted any reference from publicly issued statements about whether Gross had been armed.

A statement from Metro says only that shots were fired after the officer encountered Gross. Metro officials, including Police Chief Ronald A. Pavlik Jr., declined interview requests.

Gross was not armed with a gun, according to three officials who spoke on the condition they not be named because the investigation is ongoing. Two of those officials, one high-ranking in law enforcement, said that Gross attacked the officer with the branch, which was recovered by detectives.

Gross’s family members could not be reached Friday. According to court papers, he has an address in Manassas and once lived in Northeast Washington. Law enforcement officials described him as troubled, and a background check conducted after he was charged in the District in 2008 with unlawful possession of a firearm shows a long list of criminal offenses. They include a felony convictions for forgery and larceny of a car, both in Virginia. The gun charge in the District was dismissed.

In 1999, Gross and a 17-year-old were arrested and charged with murder in the shooting death of a man outside an apartment complex in Prince William County that was then known for drug sales. At the time, Gross listed an address on 11th Street in Northeast.

Gross was convicted of felony assault in connection with the incident and served one year in prison, according to court records filed in the District listing his criminal history. The judge suspended 14 years of a 15-year sentence.

Those D.C. court records show that Gross told authorities that he had no job and no means of support. The 2008 records show he was single and had three children, one of whom was living with him at the time. He alternately lived with a sister and a grandmother. He was born in the District.

Thursday’s shooting comes amid a period of turmoil for Metro.

In January, a passenger died after the Yellow Line train stopped in a smoke-filled tunnel, and earlier this week, the agency’s board decided to stop looking for a new general manager until it figured out what sort of leader could best help it overcome major problems with safety, finances and public relations.

In addition to extensive rail and bus lines, Metro also has a nearly 500-member armed police force that enjoys unique powers in that their jurisdiction traverses the District, Maryland and Virginia. Officers have been involved in at least four fatal police involved shootings since 1999.

The incident on Thursday night began when the operator of the Virginia-bound Metro train reported spotting an “unauthorized man” in the tunnel. The operator alerted Metro’s Rail Operations Control Center in Prince George’s County.

Metro Transit Police were dispatched around 8:53 p.m., and by 9:01 p.m. three additional police officers from that agency were on the scene and entered the tunnel. By then, Metro officials had deactivated the third rail and stopped train traffic to make entry into the tunnel safe.

Officials said the four transit officers split up as they searched for the man. When the officer encountered Gross about 9:10 p.m., she was alone; it was unclear how close the other officers were or whether they saw the confrontation.

Justin Jouvenal, Clarence Williams and Magda Jean-Louis contributed to this report.