A 28-year-old man is facing charges after he allegedly threatened to kill police officers during a standoff in Dartmouth.

Halifax Regional Police say officers spotted a man yelling and screaming as he walked down the middle of Pinecrest Drive around 4:30 p.m. Monday.

The officers recognized the man’s name and knew he was wanted on a warrant for failing to appear in court.

Police say they tried to stop him, but he fled the scene and ran into an apartment building on Jackson Road.

The officers responded to a unit in the building, told the man there was a warrant for his arrest, and asked him to come out. Police say the man then threatened to kill the officers with a knife.

The Emergency Response Team and patrol members contained the area while the man continued to yell death threats at the officers, police say.

Police obtained an arrest warrant and slid it under the door around 9 p.m. The man came out and was arrested without incident a few minutes later. The officers found a large knife inside.

No one else was inside the apartment.

Kyle Tyson Clayton of Dartmouth was held in police custody overnight. He is due to appear in Dartmouth provincial court Tuesday to face charges of failing to attend court, obstructing a police officer in the execution of his duty, as well as two counts of uttering threats and two counts of breaching a recognizance.