Bongo, 59, had been at the hospital in Saudi Arabia since October 24 when he fell ill at an economic forum.
After his arrival in Rabat on Thursday morning, the Gabonese leader was taken to a hospital in the Moroccan capital, the diplomatic source said without giving further details.
His transfer was "in accordance with the wishes of his excellency President Bongo, in agreement with the constitutional institutions of the Gabonese Republic, and in accordance with the opinion of the doctors," the Moroccan foreign ministry said in a statement.
After an extended period of silence, the Gabonese presidency eventually admitted Bongo was "seriously ill" and had undergone surgery, while insisting he was on the mend.
His recovery would take weeks, or even days, according to a source in the presidency.
Over the past month, the Gabonese presidency has released only two statements on Bongo's health, first saying on October 29 that he had been taken to hospital "suffering from severe fatigue".
Then on November 11, Bongo's office admitted he was "seriously ill" and had undergone surgery.
Lack of official news -- along with memories of the secrecy-shrouded death of Bongo's father Omar Bongo in 2009 after decades at the helm -- had sparked numerous rumours, including speculation he was incapacitated or even dead.
Earlier this month, a foreign source close to Bongo and his French-born wife Sylvia told AFP the Gabonese president had suffered a stroke.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)