The First Lady began her two-day trip to Nairobi at a national park near the Kenyan capital.
She saw zebras while in a safari vehicle, before getting up close to the elephants for feeding time at the David Sheldrick Elephant Orphanage.
But she lost her footing as the boisterous elephant bundled past.
The First Lady stuck her arm out to push the elephant away, with a frightened expression on her face.
Wildlife workers could do nothing but watch on as Melania lifted her feet to jump backwards.
The US First Lady is on a four-leg tour of Africa where she is promoting her children’s welfare programme.
Mrs Trump has started her trip by visiting the orphans elephant rescue centre, David Sheldrick Wildlife Trust, where pictures have emerged of her meeting a baby elephant dressed in an elegant white shirt and khaki trousers.
The wife of the US President fed formula to two of the elephants raised in Nairobi’s National Park and also seemed to enjoy stroking them.
CNN White House reporter, Kate Bennett, tweeted: “I have covered @FLOTUS [Melania Trump] for almost two years and have never seen her smile and laugh more than she is now with these baby elephants.”
First Lady of Kenya Margaret Kenyatta has joined Melania on her visit, which follows a trip to Ghana and Malawi.
The pair will visit the Kenya National Theatre where they will enjoy cultural performances and they are due to go on a safari to learn about animal conservation.
They have also visited an orphanage and enjoyed a children’s performance at Nairobi National Theatre.
Donald Trump tweeted: “Our country’s great First Lady, Melania, is doing really well in Africa. The people love her, and she loves them! It is a beautiful thing to see.”
Melania has recently hosted Mrs Kenyatta at the White House and said in a speech last week at the United Nations that she wanted to learn more about the Agency for International Development in Kenya.
After her trip to Kenya, the US First Lady will head to Egypt where she will be focussing on child welfare, education, tourism and conservation.
According to CBS news, Melania said: “Meeting those children and understanding their different way of life is why I wanted to travel here. I was heartened to spend time with the students, and was honored to donate school supplies and soccer balls.”
Melania’s first trip to Africa is her first extended solo international trip as First Lady.
The visit has attempted to promote the world of the US Agency for International Development.
The trip has been seen by some as a bid to mend relationships after Mr Trump said that the continent contained “shithole” countries.