Williams trailed 2-5 in the first set but won five straight games. The shift in momentum shook Safina's confidence, and the Wimbledon champion had less trouble in the second set.
"I was able to make the adjustment," Williams said. "There were some tough games there, but they kept going my way."
Williams said she probably wouldn't turn on a television to watch coverage of the U.S. presidential election.
"I'm not a super-political person," said Williams, a Jehovah's Witness who does not vote for religious reasons.
Jankovic won in windy conditions with the composure and consistency that earned her the year-end No. 1 ranking. Her Serbian compatriot alternated between spectacular winners and a number of errors, including a backhand into the net on match point.
Ivanovic entered the match with a 6-1 record against Jankovic, with the last victory coming in three sets on her way to the French Open title in June. This time, Jankovic took charge.
"I've improved so much since the last time we played," said Jankovic, who has not won a major but established late-season dominance with consecutive titles in Beijing, Stuttgart, Germany, and Moscow. "My game has gone to another level."
Jankovic often smiles during play, but she showed little emotion in an efficient performance on an outdoor hard court, a change for top players who are coming off a two-month indoor season.
Gusts swirled around the stadium at the Khalifa International Tennis Complex, and Jankovic adjusted her shot selection while Ivanovic stuck to aggressive play that allowed little margin for error.
Ivanovic paused late in the second set with dizziness caused by dehydration in humid conditions.
"I just felt so weak," said Ivanovic, who has had a string of early-round losses linked to a hand injury after her success at Roland Garros. She won a title last month at Linz, Austria.
"The conditions here are completely different," Ivanovic said. "It's also a little bit slower, so it's very hard to make a winner."
The top two in each group will advance to single-elimination play.