Two Maryland officers entered the wrong apartment while executing a drug-related search warrant Wednesday and were shot.

"The individual that we are targeting does not live at that address ... a law-abiding, hard-working citizen of Prince George's County and his daughter were home at the point where we were executing that search warrant," Prince George’s County’s Police Department (PGCPD) Chief Hank Stawinski said in a press conference, Fox News reported.

After getting tipped off that a drug dealer lived in a District Heights apartment, a team of officers from the PGCPD arrived at the wrong address to carry out a search warrant.

After knocking on the apartment door and getting no response back, the police team used a device to open it, at which point, the resident shot at the officers thinking he was being invaded by robbers. The shots wounded one officer in the hand and another one in the shoulder. The incident took place around 10:30 p.m. EDT.

One of the officers returned fire at the resident, not hitting the latter. As soon as the man realized the people he had shot at were law enforcement officers, he surrendered.

Stawinski said the man who shot the officers will not be charged, as he was not the suspect his department was targeting and merely "acted to protect himself and to protect his daughter."

According to reports, the man and his daughter had fallen asleep in front of the television and hence had not heard the officers knocking on the door or them trying to break it open.

“You got the wrong address. Don’t shoot my daughter,” the man said, according to Stawinski.

In addition, the police chief publicly apologized for the error and said his department will execute any search warrants until they have the chance to review its procedures.

Both the officers received non-life threatening injuries as a result of the incident and were flown to a Baltimore shock trauma center for treatment, department spokeswoman Jennifer Donelan told reporters Thursday.

While one of the officers was released from the hospital Thursday, the other one was scheduled to undergo surgery on an arm.

The incident was reminiscent of another incident in Dallas, Texas, earlier this month where Officer Amber Guyger, 30, mistakenly entered 26-year-old Botham Jean's apartment and shot him to death. Guyger was charged with manslaughter but wasn’t fired from the police department. The investigation into the incident is still ongoing.

People took to the streets in protest, following Jean's death. Nine of them were recently arrested for blocking entry to a Dallas Cowboys game in Arlington Texas.

Two Maryland officers entered the wrong apartment while executing a drug-related search warrant Wednesday and were shot. In this photo, police officers gather below crime scene tape in front of a Rite Aid distribution center where multiple people were killed and injured in a shooting in Aberdeen, Maryland, Sept. 20, 2018. Getty Images/ Mark Makela