Prosecutors alleged in the charge sheet that the university student posted a picture of the first lady , and wrote in his local language that the first Lady has embezzled money meant for the poor.
The prosecution accused the 23-year-old of spreading false information.
The student’s lawyer said he denied a charge of defamation during a court appearance.
The undergraduate is due to start his final exams on Monday.
It is unclear whether he will be able to do so, as he is still in detention.
His lawyer, Chijioke Kingsley Agu, told the BBC that he had applied for bail, and he hoped this would be considered within 48 hours.
Mr Mohammed’s parents have publicly implored Mrs Buhari to forgive their son. She and the authorities have not yet commented on the case.
Mr Mohammed was reportedly arrested earlier this month, but only appeared in court on Tuesday.
The prosecutors said the rough English translation of the Hausa phrase in his tweet was “Mama has embezzled monies meant for the poor”.Mr Mohammed could be sentenced to a maximum of two years in prison if convicted.
He is studying environmental management at Federal University in the northern state of Jigawa. His classmates have described him as a brilliant student.
Social media users and rights campaigners have criticised the Nigerian authorities for the treatment of the student and called for his immediate release.
Some say Nigerian officials are becoming increasingly intolerant of criticism.
Earlier this month two young TikTok users were fined and flogged in public after a court found them guilty of defaming the governor of the northern state of Kano in a video shared on social media.
Nigeria is due to hold elections in February, when President Buhari is expected to step down at the end of his second and final term.