The security ministry said that Iranian diplomats Hamzeh Doolab Ahmad and Jadidi Sohrab were declared "persona non grata" and "have left" Bosnian territory.
"As members of diplomatic personnel ... They have used their diplomatic status for activities incompatible with their diplomatic functions and the Vienna convention on diplomatic relations," the ministry said in a statement.
It did not elaborate or say when the two left Bosnia.
But a source at the ministry who asked not to be named said the two diplomats were suspected of "spying and (carrying out) other suspicious activities against the (Bosnian) constitution."
More From This Section
Such contacts were considered espionage, the source said.
Bosnia's Muslims, who make up around 40 per cent of the country's population of some 3.8 million, are mainly followers of a moderate form of Islam.
But the former Yugoslav republic is also home to a small minority of followers of Wahhabism, a strict and ultra-conservative branch of Islam which is dominant in Saudi Arabia.
Sarajevo has been cracking down on the movement's members whose number is estimated at some 3,000.