Barenboim, 72, general music director of the Berlin State Opera House, said Thursday he was in talks with Iran about a concert, in what would have been a major example of cultural diplomacy.
But an Iranian culture ministry spokesman, Hossein Noushabadi, said Barenboim could not enter the country for "security reasons", though the Berlin orchestra was welcome.
"We have no problem with the German orchestra coming to Iran, but we are opposed to the person leading that group," Noushabadi said, quoted by ISNA news agency.
Barenboim also holds Argentine and Palestinian citizenship.
German Foreign Minister Frank-Walter Steinmeier who is expected to travel to Tehran next month following a July 14 nuclear deal between Iran and six world powers, had agreed to back the concert.
Such plans had drawn an angry response from Israel, whose Culture Minister Miri Regev said she intended to send a letter of protest to German Chancellor Angela Merkel.