The former Labour MP declared, “Keir Starmer-this is for Gaza,” after receiving 12,335 votes, over 6,000 more than any other contender.
Mr. Galloway will represent the Workers Party of Britain in the Commons.
Labour had stopped endorsing candidate Azhar Ali due to comments that were widely believed to be antisemitic.
Mr. Ali expressed regret for his words.
Prior to serving as an independent and Respect Party MP in the Commons for three constituencies between 2003 and 2015, Mr. Galloway was a Labour MP until 2003.
The death of Labour MP Sir Tony Lloyd provoked a referendum in Rochdale that saw smaller parties trounce the mainstream contenders, with independent and local businessman Dave Tully coming in second.
Mr. Galloway emphasized in his victory speech the local voters’ rejection of Westminster’s two major parties.
He went on to say: “Keir Starmer and Rishi Sunak are two cheeks of the same backside and they both got well and truly spanked tonight here in Rochdale.”
A heckler who accused him of being a denial of climate change interrupted him. His supporters then yelled at her, while the rival candidate, Rev. Mark Coleman, a Just Stop Oil supporter, threw orange confetti over him.