The move came after a pre-roll advert apeared before a video featuring the Moscow17 collective, whose member Incognito was stabbed to death in south London on Wednesday.
Mars said it was “unacceptable” for its adverts to appear next to such videos and that it would be working with Google to “understand what went wrong”.
Two other males, aged 16 and 31, who also suffered stab injuries in the Camberwell incident, have been arrested on suspicion of murder.
Moscow17 are part of the drill music scene and their videos get hundreds of thousands of views on the YouTube voideo sharing platform.
Their tracks include lyrics that taunt rival group Zone 2, from Peckham.
Earlier this year, YouTube announced that they had deleted more than half of the music videos considered to be ‘violent’, with police specifically singling out ‘drill music’ for ‘promoting gang violence’. Videos were then reposted on YouTube in protest.
“It is unacceptable and disappointing to see one of our brands advertised alongside this video content,” a Mars spokesman told The Guardian. “This clearly breaches our brand safety guidelines and Mars adverts should never run alongside such content.
“We have taken the action to remove all our online advertising on YouTube and can confirm we are working with Google and our media buying agencies to understand what went wrong.
They added: “Until we have confidence that appropriate safeguards are in place, we will not advertise on YouTube.”
The past year has seen many speak out against critics of drill music. Over 6,000 people signed a petition by a drill group 1011, calling on Youtube to stop targeting the genre.
Commenting on the move, a Google spokesperson said: “We are actively working with the Metropolitan Police to review videos that may be connected with this incident. Along with others in the UK, we share the deep concern about this issue and do not want our platform used to incite violence.”