Sacked Madagascar FM Richard Randriamandranto, according to "TVM" state TV, joined 142 other countries in the October 12 UN General Assembly vote that condemned Russia's "illegal annexation" of four Ukrainian regions.
Madagascar, until then, followed a non-aligned position on the Ukraine war, rejecting pressure from the United States and Europe to criticize Russia for invading its neighbor.
Randriamandranto had taken the decision on the vote without consulting Rajoelina or Prime Minister Christian Ntsay, TVM said.
A decree signed by President Rajoelina issued on Tuesday announced Randriamandranto's departure, replaced "in the interim" by the defense minister. That statement gave no explanation for the sacking.
Rivo Rakotovao, at the HVM opposition party, said Randriamandranto was "the fall guy, [who had been fired] to fix a diplomatic error."
The General Assembly resolution was sparked by Russian President Vladimir Putin's announcement that Moscow was formally annexing four partly occupied regions -- Donetsk, Lugansk, Zaporizhzhia and Kherson -- following hastily organised referendums denounced by Ukraine and the West as shams.
The annexation was overwhelmingly condemned, by 143 votes to five. Thirty-five nations abstained, including China, India, South Africa and Pakistan.