BALTIMORE, Md. (WJZ) — One of the two men who tried to rob undercover ATF special agents in west Baltimore pleaded guilty on Tuesday.

Menard Hazelwood, 29, was charged with the assault of a federal officer and brandishing a firearm in the course of a crime of violence.

According to his plea agreement, Hazelwood and 33-year-old Donte Smith tried to rob two undercover ATF special agents on May 26, 2017.

A confidential informant made plans to purchase $2,000 worth of heroin. The undercover agents drove the informant to pick up the heroin dealer.

Once the dealer was picked up, they drove to west Baltimore to meet with the dealer’s supplier. The dealer got out of the car and told the informant and agents to wait there.

Hazelwood and Smith walked up to the car, with Smith asking for a light.

Hazelwood then pointed a gun at the undercover agent in the passenger seat and demanded money, while Smith pulled a revolver on the agent who was driving.

The agents told Hazlewood and Smith there was cash in the car, before giving a distress signal to an ATF team that was monitoring the situation.

The covert team arrived at the scene arrived at the scene a short time later, and agents ordered the two to put their hands up.

Smith reportedly fled, leading to the responding agents to shoot him.

The agents arrested Hazelwood after he tried to get into a nearby car and drive away.

Agents were able to recover the revolver used by Smith, but not the one Hazelwood used during the attempted robbery.

Hazelwood admitted that he was a part of the robbery, but that he didn’t know that the ATF agents were federal agents at the time.

If the court accepts Hazelwood’s plea agreement, he will be sentenced to between seven and 15 years in prison.

Smith is scheduled for re-arraignment on Friday.

Follow @WJZ on Twitter and like WJZ-TV | CBS Baltimore on Facebook