The idea is being discussed internally among the Islamic Republic's leadership, the senior Iranian official told Reuters, speaking on condition of anonymity. The official had no word on whether the idea had been raised with any other party.
Officials say Iran will send its neighbor advisers and weaponry, although probably not troops, to help its ally Prime Minister Nuri al-Maliki check what Tehran sees as a profound threat to regional stability, officials and analysts say.
Islamist militants have captured swathes of territory including the country's second biggest city Mosul.
Tehran is open to the possibility of working with the United States to support Baghdad, the senior official said.