The incident stemmed from a fight, which the officer tried to break up.
The suspect was shot in the abdomen or leg, but is expected to survive. The officer was not hurt.
Grand Prairie police say the fight started on a corner near Beltline Road and Pioneer Parkway around 6:15 p.m.
The officer involved works as a school resource officer assigned to the Young Women's Leadership Academy, across the street from where the fight was happening.
Police say he was alerted about a fight happening across the street from the school, so he got in his cruiser and drove over to see what the commotion was about.
He told investigators that he saw several men with weapons, including pipes and a rock.
"The police say ‘Abajo! Abajo!' like in Spanish. ‘Go down, go down,' and then he got a rock and tried to hit the police officer and then the police shoot at him," said witness Jessica Sanchez.
"The three that he drew his service revolver on, two of which immediately dropped the large pipes they had in their hands," said Det. Lyle Gensler. "The one chose not to and charged the officer with the rock over his head, and that's when he opened fire on that suspect, ending that assault."
Police believe the suspect was involved in a domestic disturbance that led up to the fight.
Several witnesses say that they saw the man use the same rock to hit a woman on the corner, and several other men working on cars nearby ran to help her. When the officer came over, he told them to drop their weapons.
The suspect is now being treated at a nearby hospital and will likely be charged with aggravated assault.
Grand Prairie police also took several others involved in the fight to headquarters to interview them.
The officer is described as a veteran and spent many years as a school resource officer.
He's now on administrative leave and will give his official interview after the mandatory three-day waiting period.