"There were isolated indications that those arrested, aged between 18 and 21 years, were participating in the preparation of a crime in connection with this event", prosecutors and police wrote in a joint statement.
German newspaper Die Welt reports that the four suspects have ties to Berlin truck attacker Anis Amri, the Tunisian man who killed 12 people when he drove a truck into a crowded Christmas market on December 19, 2016.
Die Welt reported that the main suspect, who was not identified, had prepared two knives to use in the attack.
Berlin Mayor Michael Mueller thanked security forces for preventing an "impending attack with their vigilance and police work".
Police at the Berlin half marathon today. Deutsche Welle notes that the main suspect in Sunday's planned attack was under observation by police "for some time", so police did not consider him a "concrete threat", although the thwarting of the half-marathon plot appears to have happened at the eleventh hour.
Vatican detains former diplomat in Washington embassy accused of distributing child pornography
Capella, who was in office until a year ago , was recalled from Washington last September by the Vatican. Mgr Capella, 50, was born in Italy and ordained to the priesthood in 1993 for the Archdiocese of Milan.
The suspect had in his possession two knives which had been especially sharpened for this goal, the report said.
Some 630 police officers were deployed to guard the race.
The security authorities said that on that basis and after a deadly van rampage on Saturday in the western German city of Muenster, they made a decision to swoop on the suspects. In one of the homes, search dogs indicated the presence of explosives, although police haven't released more details.
A court last month sentenced a 26-year-old Palestinian asylum seeker to life in prison for killing one and wounding six others with a knife in a Hamburg supermarket out of a "jihadist" motive last July.
The Berlin Half Marathon has been held annually in Germany's capital since the early 1980s and now attracts tens of thousands of runners from around the world. Since then the country has seen a series of attacks by Islamist extremists, as well as a rise of radical groups on the far-right.