A spokesperson for the DeSoto Police Department says a suspect has been taken into custody after the incident, apparently triggered by a domestic dispute.
Corporal Melissa Franks said it was believed an explosive device was used and the FBI and other agencies had been brought in to investigate.
Several media reports say the attacker was a former special education teacher.
The shootings began in a home in Dallas and ended soon afterwards in another house about seven miles away in DeSoto.
Two people in Dallas and two in DeSoto died of apparent gunshot wounds.
Corporal Franks said four others were wounded, including two boys aged 11 and 13.