A secret service agent accompanying her was quick to hold her to safety, although the baby elephant calmly went on with its business while Melania regained her footing with a smile.
Trump left the country after five-hours visit and headed to Kenya and she will also visit Egypt having visited Ghana.
Back at the orphanage, Mrs. Trump left the same way she arrived.
Trump greeted two administrators as she arrived at the school with Virginia Palmer, the US ambassador to Malawi.
Her visit to Africa comes months after President Trump became under fire for calling African countries "Shithole".
She is on her first-ever visit to Africa and her first extended solo worldwide trip as first lady.
It was the first lady's second stop on a four-nation tour of the African continent.
Melania Trump has sashayed to the beat of African music while being welcomed to an orphanage in Kenya.
However her choice of a white colonial-style pith helmet while on safari drew some criticism on Twitter, with one person comparing her look to that of a "colonial administrator".
She also saw a site of an ivory burn that's meant to discourage poachers.
President Trump himself has no plans to visit Africa, but praised Trump's performance overseas.
Trump was briefed on the children living at the house for babies, with staff explaining that some had been abandoned, while others had parents who had been incarcerated. Then she was encircled by a group of singing kids and danced with them.
She delighted in holding babies and held hands with older children, who sang and danced.
The first lady learned about the facility and the circumstances surrounding the children.
According to Malawi State House official says Mrs Trump was looking forward to seeing how the USA can continue working together with Malawi to support a USAid programme that is focused on children's education. "Do U?" jacket she wore on the way to visit detained migrant children in Texas in June.
Mrs Kenyatta runs the Beyond Zero campaign, a health initiative for expectant women while Mrs Trump launched Be Best initiative to improve the welfare of children.