SUNLAND PARK, N.M. (KFOX14/CBS4) — A man was arrested and charged with murder for the killing of a man in Sunland Park, New Mexico, on Monday night.

The incident occurred on Palma Drive near McNutt Road at around 4 p.m.

Officers arrested Edgar Perez.

Perez is accused of killing Jesus Alba De La Cruz.

According to documents, witnesses identified Perez as the shooter to the police.

Investigators said a man had given Perez a ride to the home. The man noticed Perez had a machete-like knife and was swinging it at the victim.

The man told them to “take it outside.”

RELATED: Sunland Park shootings leave one dead, one critically injured; suspects in custody

Perez and Alba De La Cruz walked outside.

Perez went to the vehicle and grabbed a rifle, at which then the victim swung at Perez and Perez shot him twice, according to the statement of facts.

Law enforcement obtained several surveillance videos showing Perez holding the rifle.

Officers interviewed a woman who gave a statement and told officers Perez and Alba De La Cruz were not getting along.

She told investigators she believed it stemmed from the victim claiming Perez was going out with his ex-girlfriend, the document stated. The woman stated she didn’t believe the accusation and said Perez was only defending himself as Alba De La Cruz was threatening him throughout the day, according to the court document.

Perez was arrested and charged with murder.

Sign up to receive the top interesting stories from in and around our community once daily in your inbox.