Police were conducting a manhunt in the area for two male suspects, about 80 miles (129 km) southeast of Jackson. Officials advised residents to remain indoors.
"The person or persons who did this are not safe in the city of Hattiesburg," Mayor Johnny DuPree told a news conference at the hospital.
The shooting occurred when one officer was conducting a routine traffic stop while a second one arrived to provide backup. Two civilians came upon the scene and called for help after finding the wounded officers on the ground.
The officers' identities were not initially released.
It was the city's first killing of a police officer since 1984, officials said.