A man who was allegedly armed with a machete in public was fatally shot Thursday night by police in Austin after a standoff that lasted more than 24 hours.

The Austin Police Department said in a statement that the incident began on Wednesday afternoon when officers were called to a report of a man walking in traffic, holding a knife. Officers located the man, who they say was armed with a machete in public, and attempted to gain compliance from him, without success. The statement says the man then retreated to an Austin apartment complex, where he threatened to hurt other people. Police followed him to this residence and deployed several Tasers, which were not effective, they said.

Over the next 24-plus hours, Austin police officers attempted to negotiate with the man while he was in the apartment complex in the 1200 block of 4th Av. NW. On several occasions, they used pepper gas and foam impact munitions, but the police said these devices were ineffective. At about 6 p.m. Thursday, uniform officers were posted in the area "to continue to monitor the situation," the statement said.

At about 9:30 p.m. Thursday, the man left the apartment complex and walked to a Kwik Trip gas station, as officers followed. The police say the man, armed with a knife, confronted the officers in the parking lot of the gas station. One officer discharged a firearm, striking the man, who later died at the scene, the statement said.

A spokesman for the state Bureau of Criminal Apprehension said the agency is in the early stages of investigating the shooting. More information will be released, including the names of those involved, as the investigation progresses, the spokesman said.

The Austin Police Department did not return calls or e-mails Friday seeking further information and the names of those involved.