Rau had planned on wrapping up a three-nation African tour in the tiny country on the Horn of Africa (search) on Wednesday, where he was to meet with German naval troops patrolling the Indian Ocean coast as part of the U.S.-led war on terror.
Instead, he called off the visit on the "urgent advice" of German intelligence agencies, his office said in a statement.
"According to the security agencies, Islamic circles were planning to assassinate the president," Rau's office said.
Rau, who is traveling with his wife, Christina, apologized to the German troops for canceling his visit.
"I will not let my travel plans be dictated by terrorists in the future," he said in a statement. "I am convinced, however, that to stick with the visit in these circumstances and in this particular place would put many people in considerable danger."
Rau's office did not say where the information on the attack came from, and a spokesman in Berlin refused to comment beyond the prepared statement.
Rau, whose job as president is largely ceremonial, was in Tanzania Tuesday and planned to fly directly back to Berlin on Wednesday.