Police fired tear gas to disperse the protesters as several of them scaled the roof of the German embassy and others attacked its facade and tore down the flag to replace it with a black Islamist one, the reporter said.
The mob, furious over an anti-Islam film produced in the United States that has triggered similar violence in other parts of the Arab world, then set fire to the building.
They blocked the road to prevent the arrival of firefighters, prompting the security forces to fire more tear gas.
German Foreign Minister Guido Westerwelle said staff at the country's embassy in Sudan were safe.
"The German embassy in Khartoum is currently the target of attacks by violent demonstrators. The embassy staff are safe. The crisis cell at the foreign ministry (in Berlin) is meeting and is in contact with the embassy," he said in a statement.
Demonstrators also attacked the British embassy nearby, as the British Foreign Office said it was monitoring the situation.
"We can confirm an ongoing demonstration outside the British embassy in Khartoum, and Sudanese police are at the scene," a Foreign Office spokesman told AFP in London.
Protests over a trailer for the anti-Islam film on YouTube first broke out Tuesday in Egypt and Libya, where the US consulate in Benghazi came under attack by an armed mob which killed the US ambassador and three other Americans.
The protests have since spread across other Arab and Muslim countries.
The low-budget movie Innocence of Muslims, in which actors have strong American accents, portrays Muslims as immoral and gratuitously violent.
It pokes fun at the Prophet Mohammed and touches on themes of paedophilia and homosexuality, while showing him sleeping with women, talking about killing children and referring to a donkey as "the first Muslim animal."