Updated

President Jose Manuel Santos says he has reinstated ousted Bogota Mayor Gustavo Petro after a Colombian court ordered the move.

Santos said Wednesday that he had signed a decree ordering Petro's reinstatement.

The surprise ruling late Tuesday by the Superior Tribunal of Bogota is the latest twist in an ongoing legal saga pitting the embattled leftist firebrand against Colombia's more conservative political establishment.

Petro was removed from office in March after Santos refused to heed the Inter-American Human Rights Commission's call for a stay on the Inspector General's ouster of the mayor months earlier for alleged administrative missteps.