The explosion happened at about 8:20 pm (1920 GMT) in the Jambutu area of the Adamawa state capital, although it was not immediately clear whether it was caused by a suicide bomber or an improvised explosive device.
“So far, we’ve recorded about 32 dead and about 80 injured,” said Sa’ad Bello, the Yola coordinator for the National Emergency Management Agency.
The Red Cross and state police gave a slightly lower toll of 31 dead and 72 injured.
The blast bore all the hallmarks of Boko Haram, which has previously attacked Yola with suicide bombers and improvised explosive devices in recent months.
Buhari this month was in Yola to decorate soldiers for bravery in the counter-insurgency as well as visit a camp for people displaced by six years of violence that has left at least 17,000 people dead.
He told troops he believed Boko Haram “are very close to defeat” and urged soldiers “to remain vigilant, alert and focused to prevent Boko Haram from sneaking into our communities to attack soft targets”.
Red Cross official Aliyu Maikano and residents said the area targeted was a lorry park which also houses a livestock market, an open-air restaurant and a mosque.
The area was immediately cordoned off but poor power supply in Yola meant the rescue effort was conducted in near darkness.
“Victims could be lying all over the place,” Maikano said.