During a visit to Iran last month, an Iranian news agency reported that Jean Lahiniriko congratulated Tehran for "its recent scientific realisations and its access to the peaceful nuclear technology, which is a success not only for Iran but also for all the developing countries".
Iran's uranium enrichment programme has been condemned by Western countries which accuse it of wanting to develop nuclear weapons. Iran maintains its activities are legal and peaceful.
The governing TIM party submitted a motion to impeach Lahiniriko last week and 119 out of 160 members of parliament voted to evict him from office.
The TIM party says the motion was tabled because Lahiniriko committed high treason for approving Iran's nuclear programme.
They also accuse him of not fulfilling his responsibilities as speaker of parliament.
Solofonantenaina Razoarimihaja, the head of TIM and deputy speaker, said: "It is a victory not for our party TIM, but for the whole Malagasy people."
Madagascar has close relations with the United States and France - two countries which are leading condemnation of Iran's uranium enrichment programme.
Lahiniriko told parliament last week that his comments were made unofficially when asked by an Iranian journalist and were his personal views and not meant to represent Madagascar's official position.