The probe is linked to claims he took £40 million in illegal campaign funds from Libya's Mummar Gaddafi.
French Prime Minister Manuel Valls said the judicial investigation is being carried out independently of the Socialist government, which defeated Mr Sarkozy in elections in 2012.
He said: "This situation is serious, the facts are serious. The indictment concerns magistrates, a lawyer, a former president of France.
"But as head of the government, I'm asking we recall the independence of the justice system, which must carry out its work serenely.
"No-one is above the law and there is the presumption of innocence which applies to everybody."
Lawyers for Thierry Herzog, Mr Sarkozy's lawyer, and magistrate Gilbert Azibert said the men were handed preliminary charges of influence trafficking.
The questioning centres around whether Mr Sarkozy and his lawyer were kept informed about the investigation into the Libyan allegations by Mr Azibert in exchange for promises of a post in Monaco.
He did not receive a job in Monaco and Mr Sarkozy has vigorously denied wrongdoing.
After the investigation, judges will decide whether to bring the case to trial.
Suspicions are based at least in part on taped phone conversations between Mr Sarkozy and Mr Herzog.
Mr Herzog's lawyer Paul-Albert Iweins criticised the decision to take the men into custody for questioning.