An off-duty Dallas police officer shot and detained two armed men at a Fort Worth Whataburger early Sunday morning, according to police.

The officer confronted the armed robbers as they were leaving the restaurant on White Settlement Road, police said, shooting two of them. A third person is said to have driven away from the scene in a vehicle.

The off-duty officer, along with responding Fort Worth officers, detained the two men until they could be transported to a nearby hospital.

Both of the people who were shot are recovering from their wounds, according to police.

No other injuries were reported.

Fort Worth police said the Dallas officer is an 11-year veteran with the Dallas Police Department.