Shueb Salar is alleged to have posted abusive language about women and homosexuals on Twitter, in 2012.
A spokesman for Mr Khan said: "Sadiq acted immediately to suspend Shueb Salar as soon as he was made aware of these serious issues over the weekend.
"Shueb Salar has now resigned from his role as a junior member of Sadiq's parliamentary staff."
Mr Salar, who has not commented, started working for Mr Khan in 2014.
It emerged he had also posted photos of himself at a firing range more recently on Instagram with a caption joking that he was a "hitman".
On Sunday, cabinet minister Chris Grayling questioned Mr Khan's judgement in employing Mr Salar.
"'These comments have absolutely no place in modern society," the leader of the House of Commons said.
"The mayor of London makes a large number of decisions about who to hire and how to spend public funds: his record shows Sadiq Khan can't make those decisions in a way that stands up for Londoners."
One of London mayoral hopeful Sadiq Khan's aides has resigned following his suspension on Sunday.