BERLIN (Reuters) - Iran must stop supporting armed groups in Syria and Iraq that contribute to the destabilization of the Middle East if it wants good relations with the West, German Foreign Minister Sigmar Gabriel said on Monday.

"In many conflicts in the region Iran plays a difficult role, especially in Iraq and Syria," Gabriel told a news conference with French Foreign Minister Jean-Yves Le Drian.

"The message must be that we are ready to work with the new government but we expect Iran to behave responsibly in the region, to support not terror but the politics of peace," Gabriel said, referring to the re-election of reformist President Hassan Rouhani.

"When that happens then confidence in the place as an investment location will return."

Le Drian urged Iran to vigorously implement a 2015 nuclear agreement with six powers that resulted in a lifting of most sanctions in return for curbs on Tehran's nuclear program.

(Reporting by Thomas Escritt and Hans-Edzard Busemann; Writing by Joseph Nasr; Editing by Paul Carrel)