The Respect Party candidate - who once pretended to be a cat when he appeared on Celebrity Big Brother in 2006 - won 8,557 votes to Shah’s 19,977.
Galloway has attracted controversy during his career. Bradford West was his fourth constituency. He was expelled from the Labour Party in 2003 after being found guilty of four out of five charges of bring the party into disrepute. In 2012, Galloway was criticised for saying that Julian Assange was merely being accused of "bad sexual etiquette".
Naz Shah came to the attention of the public earlier this year when she wrote of being forced to marry as a teenager. Galloway accused her of lying about the details.
Many social media pundits expressed joy that he had lost his seat.
During his defeat speech, Galloway said: “I don’t begrudge the Labour members here their moment of celebration of course.
"But there will be others who are already celebrating: the venal, the vile, the racists and the Zionists will all be celebrating. The hyena can bounce on the lion’s grave but it can never be a lion and in any case, I’m not in my grave. As a matter of fact I’m going off now to plan the next campaign."
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies